The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH mmotm] cgroup: remove rcu_read_lock() from css_get_next()
@ 2009-03-04  4:29 Bharata B Rao
  2009-03-04  4:29 ` KAMEZAWA Hiroyuki
  0 siblings, 1 reply; 2+ messages in thread
From: Bharata B Rao @ 2009-03-04  4:29 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, KAMEZAWA Hiroyuki, Balbir Singh, Dhaval Giani,
	Paul Menage, Li Zefan

cgroup: remove rcu_read_lock() from css_get_next()

Callers of css_get_next() are already calling css_get_next()
under rcu_read_lock() and hence there there is no need for
css_get_next() to re-acquire rcu_read_lock(). As per the
comments in css_get_next(), let the callers accquire the
rcu_read_lock().

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 kernel/cgroup.c |    3 ---
 1 file changed, 3 deletions(-)

--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3553,7 +3553,6 @@ css_get_next(struct cgroup_subsys *ss, i
 		return NULL;
 
 	BUG_ON(!ss->use_id);
-	rcu_read_lock();
 	/* fill start point for scan */
 	tmpid = id;
 	while (1) {
@@ -3577,8 +3576,6 @@ css_get_next(struct cgroup_subsys *ss, i
 		/* continue to scan from next id */
 		tmpid = tmpid + 1;
 	}
-
-	rcu_read_unlock();
 	return ret;
 }
 
Regards,
Bharata.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH mmotm] cgroup: remove rcu_read_lock() from css_get_next()
  2009-03-04  4:29 [PATCH mmotm] cgroup: remove rcu_read_lock() from css_get_next() Bharata B Rao
@ 2009-03-04  4:29 ` KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-03-04  4:29 UTC (permalink / raw)
  To: bharata
  Cc: Andrew Morton, linux-kernel, Balbir Singh, Dhaval Giani,
	Paul Menage, Li Zefan

On Wed, 4 Mar 2009 09:59:20 +0530
Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:

> cgroup: remove rcu_read_lock() from css_get_next()
> 
> Callers of css_get_next() are already calling css_get_next()
> under rcu_read_lock() and hence there there is no need for
> css_get_next() to re-acquire rcu_read_lock(). As per the
> comments in css_get_next(), let the callers accquire the
> rcu_read_lock().
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

Yes, thank you for pointing out. This should be done by caller.

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>


> ---
>  kernel/cgroup.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -3553,7 +3553,6 @@ css_get_next(struct cgroup_subsys *ss, i
>  		return NULL;
>  
>  	BUG_ON(!ss->use_id);
> -	rcu_read_lock();
>  	/* fill start point for scan */
>  	tmpid = id;
>  	while (1) {
> @@ -3577,8 +3576,6 @@ css_get_next(struct cgroup_subsys *ss, i
>  		/* continue to scan from next id */
>  		tmpid = tmpid + 1;
>  	}
> -
> -	rcu_read_unlock();
>  	return ret;
>  }
>  
> Regards,
> Bharata.
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-04  4:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-04  4:29 [PATCH mmotm] cgroup: remove rcu_read_lock() from css_get_next() Bharata B Rao
2009-03-04  4:29 ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox