linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: dhowells@redhat.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: oom: __task_cred() need rcu_read_lock()
Date: Fri, 20 Aug 2010 09:50:02 +0100	[thread overview]
Message-ID: <30014.1282294202@redhat.com> (raw)
In-Reply-To: <20100820084820.5FDB.A69D9226@jp.fujitsu.com>

KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:

> > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> > 
> > > dump_tasks() can call __task_cred() safely because we are holding
> > > tasklist_lock. but rcu lock validator don't have enough knowledge and
> > > it makes following annoying warning.
> > 
> > No, it can't.  The tasklist_lock is not protection against the creds
> > changing on another CPU.
> 
> Thank you for correction.
> 
> I suppose you mean I missed CONFIG_TREE_PREEMPT_RCU, right?
> As far as my grepping, other rcu implementation and spinlock use 
> preempt_disable(). In other word, Can I assume usual distro user 
> don't hit this issue?

No.  The paths by which a process changes its credentials don't normally take
tasklist_lock, so holding tasklist_lock doesn't prevent the process you're
looking at from replacing its cred and discarding the ones you're looking at.

Further, unless you're holding the RCU read lock, there's nothing theoretically
stopping the system from deleting the discarded credentials.

David

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2010-08-20  8:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19 13:06 oom: __task_cred() need rcu_read_lock() KOSAKI Motohiro
2010-08-19 15:06 ` David Howells
2010-08-20  0:08   ` KOSAKI Motohiro
2010-08-20  8:50   ` David Howells [this message]

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=30014.1282294202@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rientjes@google.com \
    /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).