Re: [PATCH v5 2/2] printk: Hide console waiter logic into helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 11 Jan 2018 13:03:41 +0100
Petr Mladek <pmladek@xxxxxxxx> wrote:

> > > +static DEFINE_RAW_SPINLOCK(console_owner_lock);
> > > +static struct task_struct *console_owner;
> > > +static bool console_waiter;
> > > +
> > > +/**
> > > + * console_lock_spinning_enable - mark beginning of code where another
> > > + *	thread might safely busy wait
> > > + *
> > > + * This might be called in sections where the current console_lock owner  
> > 
> > 
> > "might be"? It has to be called in sections where the current
> > console_lock owner can not sleep. It's basically saying "console lock is
> > now acting like a spinlock".  
> 
> I am afraid that both explanations are confusing. Your one sounds like
> it must be called every time we enter non-preemptive context in
> console_unlock. What about the following?
> 
>  * This is basically saying that "console lock is now acting like
>  * a spinlock". It can be called _only_ in sections where the current
>  * console_lock owner could not sleep. Also it must be ready to hand
>  * over the lock at the end of the section.

I would reword the above:

   * This basically converts console_lock into a spinlock. This marks
   * the section where the console_lock owner can not sleep, because
   * there may be a waiter spinning (like a spinlock). Also it must be
   * ready to hand over the lock at the end of the section.

> 
> > > + * cannot sleep. It is a signal that another thread might start busy
> > > + * waiting for console_lock.
> > > + */  
> 
> All the other changes look good to me. I will use them in the next version.

Great.

-- Steve

--
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>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux