[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120301094529.GA366@elte.hu>
Date: Thu, 1 Mar 2012 10:45:30 +0100
From: Ingo Molnar <mingo@...e.hu>
To: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Nick Piggin <npiggin@...nel.dk>,
linux-kernel <linux-kernel@...r.kernel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Andi Kleen <ak@...ux.intel.com>, linux-fsdevel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arjan van de Ven <arjan.van.de.ven@...el.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
mc@...ux.vnet.ibm.com
Subject: Re: [PATCH] cpumask: fix lg_lock/br_lock.
* Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com> 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.
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.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists