Thread (17 messages) 17 messages, 5 authors, 2017-01-25

Re: [PATCH] printk: Correctly handle preemption in console_unlock()

flat view

From: Sergey Senozhatsky <hidden>
Date: 2017-01-18 07:29:41
Also in: lkml

On (01/18/17 14:45), Sergey Senozhatsky wrote:
[..]
there is a function that clears @console_may_schedule out of
console_sem scope - console_flush_on_panic().
so I *may be* can think about a worst case scenario of race
condition between
	console_flush_on_panic()->console_may_schedule = 0 on panic CPU
and
	console_unlock()->console_may_schedule = 1 from CPU that panic CPU
failed to stop (smp_send_stop() can return with secondary CPUs still being
online).
what I mean, is that we can have, let's say, 2 CPUs spinning in
console_unlock(), both with @console_may_schedule = 1 (because secondary
CPU restores global @console_may_schedule value). now, suppose, we have
misbehaving scheduler (well, we are in panic after all). secondary CPU
will cond_resched() and may be lockup somewhere in the scheduler. which is
fine, we don't care about that secondary CPU anyway. but the same can happen
to panic CPU as well.

what do you think?

	-ss
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help