lkml.org 
[lkml]   [2007]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Bug in on_each_cpu?
Rusty Russell wrote:
> On Thu, 2007-03-01 at 03:34 -0800, Zachary Amsden wrote:
>
>> What would be really, really nice would be to statically check all
>> callsites that issue irq disables actually keep irqs disabled.
>> Presumably, there was a reason they disabled irqs, and re-enabling them
>> underneath their noses, even if it is to avoid a race, breaks the logic
>> behind that reason.
>>
>
> For the moment, how about a BUG_ON() in on_each_cpu()?
>

Sounds quite decent. But why does on_each_cpu need to disable
interrupts at all? It just calls func(), then re-enables interrupts.
So whatever was going to happen during func() that might not be
interrupt safe could just be done in the callee, avoiding the rather
expensive mess of disabling and re-enabling interrupts for those cases
where it doesn't matter.

I haven't looked at the call sites, but perhaps on_each_cpu() and
on_each_cpu_noirq() might be an appropriate distinction.

Zach
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-01 12:51    [W:0.057 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site