1. 29 Jul, 2009 19 commits
  2. 25 Jul, 2009 2 commits
  3. 24 Jul, 2009 1 commit
    • Uwe Kleine-König's avatar
      omap_mmc_probe lives in .init.text, so using platform_driver_register to · 1d604a10
      Uwe Kleine-König authored
      register it is wrong because binding a device after the init memory is
      discarded (e.g.  via sysfs) results in an oops.
      
      As requested by David Brownell platform_driver_probe is used instead of
      moving the probe function to .devinit.text as proposed initially.  This
      saves some memory, but devices registered after the driver is probed are
      not bound (probably there are none) and binding via sysfs isn't possible.
      Signed-off-by: default avatarUwe Kleine-Knig <u.kleine-koenig@pengutronix.de>
      Cc: Jean Pihet <jpihet@mvista.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Pierre Ossman <drzeus@drzeus.cx>
      Cc: Andy Lowe <alowe@mvista.com>
      Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Madhusudhan Chikkature<madhu.cr@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Matt Fleming <matt@console-pimps.org>
      Cc: Ian Molton <ian@mnementh.co.uk>
      Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      1d604a10
  4. 01 Jul, 2009 4 commits
  5. 24 Apr, 2009 1 commit
  6. 13 Jul, 2009 1 commit
  7. 24 Jun, 2009 4 commits
  8. 13 Jul, 2009 2 commits
    • Jiri Pirko's avatar
      (resend, repetitive patterns put into an inline function - not using max macro · 46d6227e
      Jiri Pirko authored
       because it's was decided not to use it in previous conversation)
      
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      46d6227e
    • Jiri Pirko's avatar
      Make ->ru_maxrss value in struct rusage filled accordingly to rss hiwater · 86610bb4
      Jiri Pirko authored
      mark.  This struct is filled as a parameter to getrusage syscall. 
      ->ru_maxrss value is set to KBs which is the way it is done in BSD
      systems.  /usr/bin/time (gnu time) application converts ->ru_maxrss to KBs
      which seems to be incorrect behavior.  Maintainer of this util was
      notified by me with the patch which corrects it and cc'ed.
      
      To make this happen we extend struct signal_struct by two fields.  The
      first one is ->maxrss which we use to store rss hiwater of the task.  The
      second one is ->cmaxrss which we use to store highest rss hiwater of all
      task childs.  These values are used in k_getrusage() to actually fill
      ->ru_maxrss.  k_getrusage() uses current rss hiwater value directly if mm
      struct exists.
      
      Note:
      exec() clear mm->hiwater_rss, but doesn't clear sig->maxrss.
      it is intetionally behavior. *BSD getrusage have exec() inheriting.
      
      Test progmam and test case
      ===========================
      
      getrusage.c
      ====
      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>
      #include <sys/types.h>
      #include <sys/time.h>
      #include <sys/resource.h>
      #include <sys/types.h>
      #include <sys/wait.h>
      #include <unistd.h>
      #include <signal.h>
      
      static void consume(int mega)
      {
      	size_t sz = mega * 1024 * 1024;
      	void *ptr;
      
      	ptr = malloc(sz);
      	memset(ptr, 0, sz);
      	usleep(1);  /* BSD rusage statics need to sleep 1 tick */
      }
      
      static void show_rusage(char *prefix)
      {
      	int err, err2;
      	struct rusage rusage_self;
      	struct rusage rusage_children;
      
      	printf("%s: ", prefix);
      	err = getrusage(RUSAGE_SELF, &rusage_self);
      	if (!err)
      		printf("self %ld ", rusage_self.ru_maxrss);
      	err2 = getrusage(RUSAGE_CHILDREN, &rusage_children);
      	if (!err2)
      		printf("children %ld ", rusage_children.ru_maxrss);
      
      	printf("\n");
      }
      
      int main(int argc, char** argv)
      {
      	int status;
      	int c;
      	int need_sleep_before_wait = 0;
      	int consume_large_memory_at_first = 0;
      	int create_child_at_first = 0;
      	int sigign = 0;
      	int create_child_before_exec = 0;
      	int after_fork_test = 0;
      
      	while ((c = getopt(argc, argv, "ceflsz")) != -1) {
      		switch (c) {
      		case 'c':
      			create_child_at_first = 1;
      			break;
      		case 'e':
      			create_child_before_exec = 1;
      			break;
      		case 'f':
      			after_fork_test = 1;
      			break;
      		case 'l':
      			consume_large_memory_at_first = 1;
      			break;
      		case 's':
      			sigign = 1;
      			break;
      		case 'z':
      			need_sleep_before_wait = 1;
      			break;
      		default:
      			break;
      		}
      	}
      
      	if (consume_large_memory_at_first)
      		consume(100);
      
      	if (create_child_at_first)
      		system("./child -q");
      
      	if (sigign)
      		signal(SIGCHLD, SIG_IGN);
      
      	if (fork()) {
      		usleep(1);
      		if (need_sleep_before_wait)
      			sleep(3); /* children become zombie */
      		show_rusage("pre_wait");
      		wait(&status);
      		show_rusage("post_wait");
      	} else {
      		usleep(1);
      		show_rusage("fork");
      
      		if (after_fork_test) {
      			consume(30);
      			show_rusage("fork2");
      		}
      		if (create_child_before_exec) {
      			system("./child -lq");
      			usleep(1);
      			show_rusage("fork3");
      		}
      
      		execl("./child", "child", 0);
      		exit(0);
      	}
      
      	return 0;
      }
      
      child.c
      ====
      #include <sys/types.h>
      #include <unistd.h>
      #include <sys/types.h>
      #include <sys/wait.h>
      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>
      #include <sys/types.h>
      #include <sys/time.h>
      #include <sys/resource.h>
      
      static void consume(int mega)
      {
      	size_t sz = mega * 1024 * 1024;
      	void *ptr;
      
      	ptr = malloc(sz);
      	memset(ptr, 0, sz);
      	usleep(1);  /* BSD rusage statics need to sleep 1 tick */
      }
      
      static void show_rusage(char *prefix)
      {
      	int err, err2;
      	struct rusage rusage_self;
      	struct rusage rusage_children;
      
      	printf("%s: ", prefix);
      	err = getrusage(RUSAGE_SELF, &rusage_self);
      	if (!err)
      		printf("self %ld ", rusage_self.ru_maxrss);
      	err2 = getrusage(RUSAGE_CHILDREN, &rusage_children);
      	if (!err2)
      		printf("children %ld ", rusage_children.ru_maxrss);
      
      	printf("\n");
      
      }
      
      int main(int argc, char** argv)
      {
      	int status;
      	int c;
      	int silent = 0;
      	int light_weight = 0;
      
      	while ((c = getopt(argc, argv, "lq")) != -1) {
      		switch (c) {
      		case 'l':
      			light_weight = 1;
      			break;
      		case 'q':
      			silent = 1;
      			break;
      		default:
      			break;
      		}
      	}
      
      	if (!silent)
      		show_rusage("exec");
      
      	if (fork()) {
      		if (light_weight)
      			consume(400);
      		else
      			consume(700);
      		wait(&status);
      	} else {
      		if (light_weight)
      			consume(600);
      		else
      			consume(900);
      
      		exit(0);
      	}
      
      	return 0;
      }
      
      testcase
      ========
      
      1. inherit fork?
      
         test way:
         	% ./getrusage -lc
      
         bsd result:
         	fork line is "fork: self 0 children 0".
      
         	-> rusage sholdn't be inherit by fork.
      	   (both RUSAGE_SELF and RUSAGE_CHILDREN)
      
      2. inherit exec?
      
         test way:
         	% ./getrusage -lce
      
         bsd result:
         	fork3: self 103204 children 60000
      	exec: self 103204 children 60000
      
         	fork3 and exec line are the same.
      
         	-> rusage shold be inherit by exec.
      	   (both RUSAGE_SELF and RUSAGE_CHILDREN)
      
      3. getrusage(RUSAGE_CHILDREN) collect grandchild statics?
      
         test way:
         	% ./getrusage
      
         bsd result:
         	post_wait line is about "post_wait: self 0 children 90000".
      
      	-> RUSAGE_CHILDREN can collect grandchild.
      
      4. zombie, but not waited children collect or not?
      
         test way:
         	% ./getrusage -z
      
         bsd result:
         	pre_wait line is "pre_wait: self 0 children 0".
      
      	-> zombie child process (not waited-for child process)
      	   isn't accounted.
      
      5. SIG_IGN collect or not
      
         test way:
         	% ./getrusage -s
      
         bsd result:
         	post_wait line is "post_wait: self 0 children 0".
      
      	-> if SIGCHLD is ignored, children isn't accounted.
      
      6. fork and malloc
         test way:
         	% ./getrusage -lcf
      
         bsd result:
         	fork line is "fork: self 0 children 0".
         	fork2 line is about "fork: self 130000 children 0".
      
         	-> rusage sholdn't be inherit by fork.
      	   (both RUSAGE_SELF and RUSAGE_CHILDREN)
      	   but additional memory cunsumption cause right
      	   maxrss calculation.
      Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
      Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      86610bb4
  9. 14 Aug, 2009 6 commits
    • Joe Perches's avatar
      Allow control over the elimination of duplicate email names and addresses · ec1948b8
      Joe Perches authored
      --remove-duplicates will use the first email name or address presented
      --noremove-duplicates will emit all names and addresses
      
      --remove-duplicates is enabled by default
      
      For instance:
      
      $ ./scripts/get_maintainer.pl -f drivers/char/tty_ioctl.c
      Greg Kroah-Hartman <gregkh@suse.de>
      Alan Cox <alan@linux.intel.com>
      Mike Frysinger <vapier@gentoo.org>
      Alexey Dobriyan <adobriyan@gmail.com>
      linux-kernel@vger.kernel.org
      
      $ ./scripts/get_maintainer.pl -f --noremove-duplicates drivers/char/tty_ioctl.c
      Greg Kroah-Hartman <gregkh@suse.de>
      Alan Cox <alan@redhat.com>
      Alan Cox <alan@linux.intel.com>
      Alan Cox <alan@lxorguk.ukuu.org.uk>
      Mike Frysinger <vapier@gentoo.org>
      Alexey Dobriyan <adobriyan@gmail.com>
      linux-kernel@vger.kernel.org
      
      Using --remove-duplicates could eliminate multiple maintainers that
      share the same name but not the same email address.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      ec1948b8
    • Joe Perches's avatar
      If a person sets a separator, it's only used if --nomultiline is set. · e90114c2
      Joe Perches authored
      Don't make the command line also include --nomultiline in that case.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e90114c2
    • Joe Perches's avatar
      Add reading and using .mailmap file if it exists · 6ca6e06f
      Joe Perches authored
      Convert address entries in .mailmap to first encountered address
      Don't terminate shell commands with \n
      Strip characters found after sign-offs by: name <address> [stripped]
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6ca6e06f
    • Joe Perches's avatar
      Added format_email and parse_email routines to reduce inline use. · 95c698ef
      Joe Perches authored
      Added email_address_inuse to eliminate multiple maintainer entries
      for the same email address, the first name encountered is used.
      
      Used internal perl equivalents of shell cmd use of grep|cut|sort|uniq
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      95c698ef
    • Joe Perches's avatar
      --pattern-depth is used to control how many levels of directory traversal · 364c37e5
      Joe Perches authored
      should be performed to find maintainers.  default is 0 (all directory levels).
      
      For instance:
      
      MAINTAINERS currently has multiple M: and F: entries that match
      net/netfilter/ipvs/ip_vs_app.c
      
      IPVS
      M:	Wensong Zhang <wensong@linux-vs.org>
      M:	Simon Horman <horms@verge.net.au>
      M:	Julian Anastasov <ja@ssi.bg>
      [...]
      F:	net/netfilter/ipvs/
      
      NETFILTER/IPTABLES/IPCHAINS
      [...]
      M:	Patrick McHardy <kaber@trash.net>
      [...]
      F:	net/netfilter/
      
      NETWORKING [GENERAL]
      M:	"David S. Miller" <davem@davemloft.net>
      [...]
      F:	net/
      
      THE REST
      M:	Linus Torvalds <torvalds@linux-foundation.org>
      [...]
      F:	*/
      
      Using this command will return all of those maintainers:
      (except Linus unless --git-chief-maintainers is specified)
      
      $ ./scripts/get_maintainer.pl --nogit -nol \
      	-f net/netfilter/ipvs/ip_vs_app.c
      Julian Anastasov <ja@ssi.bg>
      Simon Horman <horms@verge.net.au>
      Wensong Zhang <wensong@linux-vs.org>
      Patrick McHardy <kaber@trash.net>
      David S. Miller <davem@davemloft.net>
      
      Adding --pattern-depth=1 will match at the deepest level
      $ ./scripts/get_maintainer.pl --nogit -nol --pattern-depth=1 \
      	-f net/netfilter/ipvs/ip_vs_app.c
      Julian Anastasov <ja@ssi.bg>
      Simon Horman <horms@verge.net.au>
      Wensong Zhang <wensong@linux-vs.org>
      
      Adding --pattern-depth=2 will match at the deepest level and 1 higher
      $ ./scripts/get_maintainer.pl --nogit -nol --pattern-depth=2 \
      	-f net/netfilter/ipvs/ip_vs_app.c
      Julian Anastasov <ja@ssi.bg>
      Simon Horman <horms@verge.net.au>
      Wensong Zhang <wensong@linux-vs.org>
      Patrick McHardy <kaber@trash.net>
      
      and so on.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      364c37e5
    • Joe Perches's avatar
      Before this change, matched sections were added in the order · b7ced817
      Joe Perches authored
      of appearance in the normally alphabetic section order of
      the MAINTAINERS file.
      
      For instance, finding the maintainer for drivers/scsi/wd7000.c
      would first find "SCSI SUBSYSTEM", then "WD7000 SCSI SUBSYSTEM",
      then "THE REST".
      
      before patch:
      
      $ ./scripts/get_maintainer.pl --nogit -f drivers/scsi/wd7000.c
      James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
      Miroslav Zagorac <zaga@fly.cc.fer.hr>
      linux-scsi@vger.kernel.org
      linux-kernel@vger.kernel.org
      
      get_maintainer.pl now selects matched sections by longest pattern match.
      Longest is the number of "/"s and any specific file pattern.
      
      This changes the example output order of MAINTAINERS to whatever is
      selected in "WD7000 SUBSYSTEM", then "SCSI SYSTEM", then "THE REST".
      
      after patch:
      
      $ ./scripts/get_maintainer.pl --nogit -f drivers/scsi/wd7000.c
      Miroslav Zagorac <zaga@fly.cc.fer.hr>
      James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
      linux-scsi@vger.kernel.org
      linux-kernel@vger.kernel.org
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b7ced817