Re: [PATCH 3/3] printk: Avoid all wakeups from printk

From: Ingo Molnar
Date: Thu Jun 09 2011 - 10:20:14 EST



* Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:

> On Thu, 2011-06-09 at 15:55 +0200, Ingo Molnar wrote:
>
> > > @@ -943,19 +939,14 @@ asmlinkage int vprintk(const char *fmt,
> > > if (*p == '\n')
> > > new_text_line = 1;
> > > }
> > > + printk_cpu = UINT_MAX;
> > > + spin_unlock(&logbuf_lock);
> >
> > Hm, is that printk_cpu setting inside the critical section safe? What
> > happens if we get an NMI on this CPU in that window?
>
> That's what the old code did, also NMI really shouldn't printk(), but
> yeah, can flip those two lines, but in that same vein I should also flip
> the setting of that variable with acquiring the lock.

Flipping it won't be enough - we could override another CPU's
protection ...

Thanks,

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