netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: peterz@infradead.org, lizf@cn.fujitsu.com,
	herbert@gondor.hengli.com.au, davej@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cls_cgroup: Fix rcu lockdep warning
Date: Thu, 2 Sep 2010 10:16:46 -0700	[thread overview]
Message-ID: <20100902171646.GC2349@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100902.100551.115929058.davem@davemloft.net>

On Thu, Sep 02, 2010 at 10:05:51AM -0700, David Miller wrote:
> From: Peter Zijlstra <peterz@infradead.org>
> Date: Thu, 02 Sep 2010 12:38:36 +0200
> 
> > On Thu, 2010-09-02 at 14:30 +0800, Li Zefan wrote:
> >> Calling task_subsys_state() without holding rcu_read_lock or
> >> cgroup_mutex can cause lockdep warning.
> >> 
> > 
> > That is not a suitable changelog.
> > 
> > Was the warning correct? Is your patch correct? What does RCU protect
> > here and why can we use classid after dropping it.
> > 
> > Simply frobbing code to make the warning go away is not good.
> 
> In fact shouldn't this be a rcu_dereference() or similar?

The rcu_dereference() is there, just buried in task_subsys_state_check()
which is called from task_subsys_state().  The code extracts the classid,
which is an integer, so the RCU-protected pointer does not leak out of
the RCU read-side critical section.

So this is OK, but the changelog should indeed say why it is OK.

							Thanx, Paul

  reply	other threads:[~2010-09-02 17:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-02  6:30 [PATCH] cls_cgroup: Fix rcu lockdep warning Li Zefan
2010-09-02 10:38 ` Peter Zijlstra
2010-09-02 17:05   ` David Miller
2010-09-02 17:16     ` Paul E. McKenney [this message]
2010-09-03  1:10   ` Li Zefan
2010-09-03  4:52 ` Herbert Xu

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=20100902171646.GC2349@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.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 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).