All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf.kern-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jiri Olsa <jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: paul.moore-VXdhtT5mjnY@public.gmane.org,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	dipankar-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org,
	johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org
Subject: Re: [PATCH 1/3] cgroup - removing superfluous rcu_read_lock_held check
Date: Wed, 03 Nov 2010 01:54:55 +0800	[thread overview]
Message-ID: <4CD0506F.6080600__29265.0222931572$1288720554$gmane$org@gmail.com> (raw)
In-Reply-To: <1288638909-10541-2-git-send-email-jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

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/containers

  parent reply	other threads:[~2010-11-02 17:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 19:15 [PATCH 0/3] rcu - removing superfluous rcu_read_lock_held check Jiri Olsa
2010-11-01 19:15 ` Jiri Olsa
2010-11-01 19:15 ` [PATCH 1/3] cgroup " Jiri Olsa
     [not found]   ` <1288638909-10541-2-git-send-email-jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-11-02 17:54     ` Li Zefan [this message]
2010-11-02 17:54   ` Li Zefan
     [not found]     ` <4CD0506F.6080600-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-03  8:58       ` Jiri Olsa
     [not found]         ` <20101103085804.GB1916-4G3mNVrOt0i3oHxwIazZmlaTQe2KTcn/@public.gmane.org>
2010-11-03 18:40           ` Li Zefan
2010-11-01 19:15 ` [PATCH 2/3] kernel,cred,kvm,security " Jiri Olsa
2010-11-01 22:42   ` Paolo Bonzini
     [not found]     ` <4CCF424F.3050205-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-11-02  7:21       ` Jiri Olsa
2010-11-02  7:21         ` Jiri Olsa
     [not found]   ` <1288638909-10541-3-git-send-email-jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-11-01 22:42     ` [PATCH 2/3] kernel, cred, kvm, security " Paolo Bonzini
     [not found] ` <1288638909-10541-1-git-send-email-jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-11-01 19:15   ` [PATCH 1/3] cgroup " Jiri Olsa
2010-11-01 19:15   ` [PATCH 2/3] kernel, cred, kvm, security " Jiri Olsa
2010-11-01 19:15   ` [PATCH 3/3] net " Jiri Olsa
2010-11-01 19:15 ` Jiri Olsa
2010-11-01 20:33   ` David Miller
     [not found]   ` <1288638909-10541-4-git-send-email-jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-11-01 20:33     ` David Miller
2010-11-01 21:47     ` Paul Moore
2010-11-01 21:47   ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='4CD0506F.6080600__29265.0222931572$1288720554$gmane$org@gmail.com' \
    --to=lizf.kern-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dipankar-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=paul.moore-VXdhtT5mjnY@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.