Tetsuo Handa wrote: > John Hubbard wrote: > > On 11/03/2017 02:46 PM, John Hubbard wrote: > > > On 11/03/2017 04:54 AM, Steven Rostedt wrote: > > >> On Fri, 3 Nov 2017 07:21:21 -0400 > > >> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > [...] > > >> > > >> I'll condense the patch to show what I mean: > > >> > > >> To become a waiter, a task must do the following: > > >> > > >> + printk_safe_enter_irqsave(flags); > > >> + > > >> + raw_spin_lock(&console_owner_lock); > > >> + owner = READ_ONCE(console_owner); > > >> + waiter = READ_ONCE(console_waiter); > > When CPU0 is writing to consoles after "console_owner = current;", > what prevents from CPU1 and CPU2 concurrently reached this line from > seeing waiter == false && owner != NULL && owner != current (which will > concurrently set console_waiter = true and spin = true) without > using atomic instructions? Oops. I overlooked that console_owner_lock is held. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>