mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Helsley <matthltc@us.ibm.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Lai JIangshan <laijs@cn.fujitsu.com>,
	Paul Menage <menage@google.com>,
	Matt Helsley <matthltc@us.ibm.com>,
	Cedric Le Goater <clg@vnet.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"containers@lists.osdl.org" <containers@lists.osdl.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] cgroup: Check task_lock in task_subsys_state()
Date: Thu, 22 Apr 2010 20:00:52 -0700	[thread overview]
Message-ID: <20100423030052.GC32490@count0.beaverton.ibm.com> (raw)
In-Reply-To: <4BD10788.8060006@cn.fujitsu.com>

On Fri, Apr 23, 2010 at 10:35:52AM +0800, Li Zefan wrote:
> task_subsys_state() is safe under task_lock(). See
> Documentation/cgroups/cgroups.txt for locking rule.
> 
> This fixes an RCU warning when resume from suspend. The
> warning comes from freezer cgroup in cgroup_freezing_or_frozen().
> 
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

Acked-by: Matt Helsley <matthltc@us.ibm.com>

> ---
> 
> I'm not sure which is preferable - access ->alloc_lock directly
> like this patch or add task_lock_is_held() in sched.h
> 
> ---
>  include/linux/cgroup.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
> index b8ad1ea..8f78073 100644
> --- a/include/linux/cgroup.h
> +++ b/include/linux/cgroup.h
> @@ -530,6 +530,7 @@ static inline struct cgroup_subsys_state *task_subsys_state(
>  {
>  	return rcu_dereference_check(task->cgroups->subsys[subsys_id],
>  				     rcu_read_lock_held() ||
> +				     lockdep_is_held(&task->alloc_lock) ||
>  				     cgroup_lock_is_held());
>  }
> 
> -- 
> 1.6.3

  reply	other threads:[~2010-04-23  3:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23  2:35 Li Zefan
2010-04-23  3:00 ` Matt Helsley [this message]
2010-04-23  4:10 ` Paul E. McKenney

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=20100423030052.GC32490@count0.beaverton.ibm.com \
    --to=matthltc@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=clg@vnet.ibm.com \
    --cc=containers@lists.osdl.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=menage@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®