OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 0/3] rcu - removing superfluous rcu_read_lock_held check
Re: [PATCH 1/3] cgroup - removing superfluous rcu_read_lock_held check [message #41966 is a reply to message #41958] Tue, 02 November 2010 17:54 Go to previous messageGo to previous message
Li Zefan is currently offline  Li Zefan
Messages: 90
Registered: February 2008
Member
On 2010年11月02日 03:15, Jiri Olsa wrote:
> hi,

This..

> the rcu_dereference_check is defined as
>
> #define rcu_dereference_check(p, c) \
> __rcu_dereference_check((p), rcu_read_lock_held() || (c), __rcu)
>
> so the caller does not need to specify rcu_read_lock_held() condition.
>

> wbr,
> jirka

and this should be excluded from the changelog.

>
>
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>

Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>

However a nitpick:

> ---
> include/linux/cgroup.h | 1 -
> kernel/cgroup.c | 6 ++----
> 2 files changed, 2 insertions(+), 5 deletions(-)
...
> @@ -4544,7 +4542,7 @@ unsigned short css_id(struct cgroup_subsys_state *css)
> * it's unchanged until freed.
> */
> cssid = rcu_dereference_check(css->id,
> - rcu_read_lock_held() || atomic_read(&css->refcnt));
> + atomic_read(&css->refcnt));

Now the 2 lines can be made into one line and still fit into 80 chars.

>
> if (cssid)
> return cssid->id;
> @@ -4557,7 +4555,7 @@ unsigned short css_depth(struct cgroup_subsys_state *css)
> struct css_id *cssid;
>
> cssid = rcu_dereference_check(css->id,
> - rcu_read_lock_held() || atomic_read(&css->refcnt));
> + atomic_read(&css->refcnt));

dito

>
> if (cssid)
> return cssid->depth;
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [PATCH] cgroup: Avoid a memset by using vzalloc
Next Topic: [PATCH v2] cgroup: prefer [kv]zalloc[_node] over [kv]malloc+memset in memory controller code.
Goto Forum:
  


Current Time: Thu Jul 31 19:02:20 GMT 2025

Total time taken to generate the page: 0.34274 seconds