From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Srivatsa S. Bhat" Subject: Re: [PATCH] cpumask: fix lg_lock/br_lock. Date: Thu, 01 Mar 2012 15:26:26 +0530 Message-ID: <4F4F47CA.2060900@linux.vnet.ibm.com> References: <87ehtf3lqh.fsf@rustcorp.com.au> <20120227155338.7b5110cd.akpm@linux-foundation.org> <20120228084359.GJ21106@elte.hu> <20120228132719.f375071a.akpm@linux-foundation.org> <4F4DBB26.2060907@linux.vnet.ibm.com> <20120229091732.GA11505@elte.hu> <4F4E083A.2080304@linux.vnet.ibm.com> <20120301073845.GA5350@elte.hu> <4F4F3E16.5080703@linux.vnet.ibm.com> <20120301094529.GA366@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Andrew Morton , Rusty Russell , Nick Piggin , linux-kernel , Alexander Viro , Andi Kleen , linux-fsdevel@vger.kernel.org, Peter Zijlstra , Arjan van de Ven , "Paul E. McKenney" , mc@linux.vnet.ibm.com To: Ingo Molnar Return-path: Received: from e28smtp07.in.ibm.com ([122.248.162.7]:51704 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758796Ab2CAJ4k (ORCPT ); Thu, 1 Mar 2012 04:56:40 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Mar 2012 15:26:35 +0530 In-Reply-To: <20120301094529.GA366@elte.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 03/01/2012 03:15 PM, Ingo Molnar wrote: > > * Srivatsa S. Bhat wrote: > >> We wanted to avoid doing for_each_possible_cpu() to avoid the >> unnecessary performance hit. [...] > > That was done at the cost of making the code rather complex. > Sadly, yes.. > The thing is, *ANY* cpu-mask loop is an utter slowpath, so the > "performance hit" is an overstatement. There's already dozens of > of for_each_possible_cpu() loops in the kernel, and it's a > perfectly acceptable solution in such cases. > > I suspect it does not matter much now as the code appears to be > correct, but in general we want to opt for simpler designs for > rare and fragile codepaths. > Ok, makes sense. And now looking back at the amount of complexity we built into this just to avoid the for_each_possible_cpu() loop, I wonder why we went to such lengths at all! (considering what you said above about any cpu-mask loop..) Regards, Srivatsa S. Bhat