From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754709Ab0CLCOY (ORCPT ); Thu, 11 Mar 2010 21:14:24 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:35666 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753782Ab0CLCOW (ORCPT ); Thu, 11 Mar 2010 21:14:22 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: paulmck@linux.vnet.ibm.com Subject: Re: [PATCH] cpuset: current_cpuset_is_being_rebound() need rcu lock Cc: kosaki.motohiro@jp.fujitsu.com, Miao Xie , Paul Menage , David Rientjes , Li Zefan , Nick Piggin , LKML In-Reply-To: <20100312020056.GB6389@linux.vnet.ibm.com> References: <20100312085807.950B.A69D9226@jp.fujitsu.com> <20100312020056.GB6389@linux.vnet.ibm.com> Message-Id: <20100312110933.950E.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Fri, 12 Mar 2010 11:14:19 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Fri, Mar 12, 2010 at 09:03:03AM +0900, KOSAKI Motohiro wrote: > > > On Thu, Mar 11, 2010 at 02:46:15PM +0900, KOSAKI Motohiro wrote: > > > > rcu lockdep detected cpuset have wrong rcu usage. > > > > the fixing is trivial. but I wonder why don't cpuset_being_rebound assignment > > > > and read need a memory barrier pairing? > > > > > > The fix is in -tip, commit 99ee4ca746dda71326db7645463b4075ac1d665c. > > > > > > This is an initialization-time use of rcu_dereference(), so no other > > > task has a reference to this data. Hence it is constant. Other uses > > > of this code operate on shared data structures, which might change at > > > any time. > > > > thanks. I haven't notice such commit. > > > > I think you are talking about task_cs(current) accessing and you are right > > in such point. > > but I'm talking cpuset_being_rebound global variable. > > > > update_tasks_nodemask() has following code > > > > static void update_tasks_nodemask(struct cpuset *cs, const nodemask_t *oldmem, > > struct ptr_heap *heap) > > { > > cpuset_being_rebound = cs; /* start transaction */ > > cgroup_scan_tasks(&scan); > > cpuset_being_rebound = NULL; /* end transaction */ > > } > > Hmmm... What commit are you looking at in what tree? I instead see > a much larger function body for update_tasks_nodemask(). I am looking > in a number of places, including 522dba7134d6b2e5821d3457f7941ec34f668e6d > in Linus's git tree. Ahh, I'm sorry. I wrote essential piece of the function instead full cut-n-paste. Plus, my previous explanation was too little and unclear. I don't think your commit is wrong. it is definitely right. I only talked about I think current_cpuset_is_being_rebound() has another sick.