From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id DC0FCB6FD1 for ; Sat, 5 May 2012 11:48:43 +1000 (EST) Received: by obbup19 with SMTP id up19so4953274obb.38 for ; Fri, 04 May 2012 18:48:40 -0700 (PDT) Date: Fri, 4 May 2012 18:47:14 -0700 From: Anton Vorontsov To: Andrew Morton Subject: Re: [PATCH 1/9] cpu: Introduce clear_tasks_mm_cpumask() helper Message-ID: <20120505014711.GA24566@lizard> References: <20120423070641.GA27702@lizard> <20120423070736.GA30752@lizard> <20120426165911.00cebd31.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <20120426165911.00cebd31.akpm@linux-foundation.org> Cc: linaro-kernel@lists.linaro.org, Mike Frysinger , Peter Zijlstra , user-mode-linux-devel@lists.sourceforge.net, linux-sh@vger.kernel.org, Richard Weinberger , linuxppc-dev@lists.ozlabs.org, Oleg Nesterov , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Mundt , John Stultz , patches@linaro.org, KOSAKI Motohiro , Russell King , uclinux-dist-devel@blackfin.uclinux.org, linux-arm-kernel@lists.infradead.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, Apr 26, 2012 at 04:59:11PM -0700, Andrew Morton wrote: [...] > > so its not like new tasks will ever get this cpu set in > > + * their mm mask. -- Peter Zijlstra > > + * Thus, we may use rcu_read_lock() here, instead of grabbing > > + * full-fledged tasklist_lock. > > + */ > > + rcu_read_lock(); > > + for_each_process(p) { > > + struct task_struct *t; > > + > > + t = find_lock_task_mm(p); > > + if (!t) > > + continue; > > + cpumask_clear_cpu(cpu, mm_cpumask(t->mm)); > > + task_unlock(t); > > + } > > + rcu_read_unlock(); > > +} > > It is good that this code exists under CONFIG_HOTPLUG_CPU. Did you > check that everything works correctly with CONFIG_HOTPLUG_CPU=n? Yeah, only the code under CONFIG_HOTPLUG_CPU calls the function, so it should be all fine. Thanks! -- Anton Vorontsov Email: cbouatmailru@gmail.com