lkml.org 
[lkml]   [2017]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: d57108d4f6 ("watchdog/core: Get rid of the thread .."): BUG: unable to handle kernel NULL pointer dereference at 0000000000000208
On Sat, Sep 16, 2017 at 10:35 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Don't bother. I found it already. On UP we have:
>
> #define for_each_cpu(cpu, mask) \
> for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
>
> which is a total fail as it breaks any code which uses for_each_cpu() or
> any of the other variants on UP by assuming that all cpumask have bit 0
> set.

It's fairly fundamental. UP assumes that all CPU masks are always that
"one CPU set". Not just here - everywhere.

I guess we could somehow try to move away from that, but really, the
assumption of fixed masks ends up simplifying the code generation a
lot, so it made tons of sense back when UP was a primary target.

So it's an approach that is somewhat historical, but I'm not sure it's
worth re-visiting that old decision. People should simply not expect
to traverse over empty masks in anything that is UP.

So I suspect your perf fix is the right one, and maybe we could/should
just make people more aware of the empty cpumask issue with UP.

Linus

\
 
 \ /
  Last update: 2017-09-16 19:56    [W:0.049 / U:1.684 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site