lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180112103754.1916a1e2@gandalf.local.home>
Date:   Fri, 12 Jan 2018 10:37:54 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        akpm@...ux-foundation.org, linux-mm@...ck.org,
        Cong Wang <xiyou.wangcong@...il.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...nel.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Peter Zijlstra <peterz@...radead.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Jan Kara <jack@...e.cz>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        rostedt@...e.goodmis.org, Byungchul Park <byungchul.park@....com>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Tejun Heo <tj@...nel.org>, Pavel Machek <pavel@....cz>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/2] printk: Hide console waiter logic into helpers

On Thu, 11 Jan 2018 13:03:41 +0100
Petr Mladek <pmladek@...e.com> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ