All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.hengli.com.au>,
	Dave Jones <davej@redhat.com>, netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH] cls_cgroup: Fix rcu lockdep warning
Date: Fri, 03 Sep 2010 09:10:00 +0800	[thread overview]
Message-ID: <4C804AE8.1090203@cn.fujitsu.com> (raw)
In-Reply-To: <1283423916.2059.1847.camel@laptop>

Peter Zijlstra wrote:
> 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.
> 
> 

task->cgroups and task->cgroups->subsys[i] are protected by RCU.
So we avoid accessing invalid pointers here. This can happen,
for example, when you are deref those pointers while someone move
@task from one cgroup to another.

otoh, there is no lock rule for ->classid.

  parent reply	other threads:[~2010-09-03  1:04 UTC|newest]

Thread overview: 7+ 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
2010-09-03  1:10   ` Li Zefan [this message]
2010-09-03  4:52 ` Herbert Xu
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=4C804AE8.1090203@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --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 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.