lkml.org 
[lkml]   [2012]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpumask: fix lg_lock/br_lock.
On 03/01/2012 03:15 PM, Ingo Molnar wrote:

>
> * Srivatsa S. Bhat <srivatsa.bhat@linux.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.
>


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



\
 
 \ /
  Last update: 2012-03-01 10:59    [W:0.710 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site