LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/2] k_getrusage: don't take rcu_read_lock()
@ 2008-02-18 17:07 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2008-02-18 17:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Eric W. Biederman, Paul E. McKenney, Roland McGrath, linux-kernel

(just a trivial example, more to come)

k_getrusage() holds rcu_read_lock() because it was previously required by
lock_task_sighand(). Unneeded now.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 25/kernel/sys.c~2_GRU	2008-02-15 16:59:17.000000000 +0300
+++ 25/kernel/sys.c	2008-02-18 19:15:40.000000000 +0300
@@ -1548,11 +1548,8 @@ static void k_getrusage(struct task_stru
 	memset((char *) r, 0, sizeof *r);
 	utime = stime = cputime_zero;
 
-	rcu_read_lock();
-	if (!lock_task_sighand(p, &flags)) {
-		rcu_read_unlock();
+	if (!lock_task_sighand(p, &flags))
 		return;
-	}
 
 	switch (who) {
 		case RUSAGE_BOTH:
@@ -1595,9 +1592,7 @@ static void k_getrusage(struct task_stru
 		default:
 			BUG();
 	}
-
 	unlock_task_sighand(p, &flags);
-	rcu_read_unlock();
 
 	cputime_to_timeval(utime, &r->ru_utime);
 	cputime_to_timeval(stime, &r->ru_stime);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-18 17:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-18 17:07 [PATCH 2/2] k_getrusage: don't take rcu_read_lock() Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).