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]
Date:	Fri, 18 Sep 2015 08:49:56 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Boqun Feng <boqun.feng@...il.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
	Jonathan Corbet <corbet@....net>,
	Michal Hocko <mhocko@...nel.org>,
	David Howells <dhowells@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Will Deacon <will.deacon@....com>
Subject: Re: [PATCH] Documentation: Remove misleading examples of the
 barriers in wake_*()

On Thu, Sep 17, 2015 at 07:01:11PM +0200, Oleg Nesterov wrote:
> On 09/17, Peter Zijlstra wrote:
> >
> > Included in it are some of the details on this subject, because a wakeup
> > has two prior states that are of importance, the tasks own prior state
> > and the wakeup state, both should be considered in the 'program order'
> > flow.
> 
> Great. Just one question,
> 
> > + *   BLOCKING -- aka. SLEEP + WAKEUP
> > + *
> > + * For blocking things are a little more interesting, because when we dequeue
> > + * the task, we don't need to acquire the old rq lock in order to migrate it.
> > + *
> > + * Say CPU0 does a wait_event() and CPU1 does the wake() and migrates the task
> > + * to CPU2 (the most complex example):
> > + *
> > + *   CPU0 (schedule)  CPU1 (try_to_wake_up) CPU2 (sched_ttwu_pending)
> > + *
> > + *   X->state = UNINTERRUPTIBLE
> > + *   MB
> > + *   if (cond)
> > + *     break
> > + *                    cond = true
> > + *
> > + *   WMB              WMB (aka smp_mb__before_spinlock)
> 
> Yes, both CPU's do WMB-aka-smp_mb__before_spinlock...
> 
> But afaics in this particular case we do not really need them?
> So perhaps we should not even mention them?
> 
> Because (if I am right) this can confuse the reader who will try
> to understand how/where do we rely on these barriers.

Good point. Initially I put all barriers in, but now that we've figured
out which are important (the text is correct, right? please double
check) we can remove the rest.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ