From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with SMTP id 326666B02DF for ; Fri, 20 Aug 2010 04:50:17 -0400 (EDT) From: David Howells In-Reply-To: <20100820084820.5FDB.A69D9226@jp.fujitsu.com> References: <20100820084820.5FDB.A69D9226@jp.fujitsu.com> <20100819220338.5FD5.A69D9226@jp.fujitsu.com> <7682.1282230394@redhat.com> Subject: Re: oom: __task_cred() need rcu_read_lock() Date: Fri, 20 Aug 2010 09:50:02 +0100 Message-ID: <30014.1282294202@redhat.com> Sender: owner-linux-mm@kvack.org To: KOSAKI Motohiro Cc: dhowells@redhat.com, "Paul E. McKenney" , LKML , linux-mm , Andrew Morton , David Rientjes , KAMEZAWA Hiroyuki List-ID: KOSAKI Motohiro wrote: > > KOSAKI Motohiro 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: email@kvack.org