From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752385AbbJFQHA (ORCPT ); Tue, 6 Oct 2015 12:07:00 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:45254 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbbJFQG6 (ORCPT ); Tue, 6 Oct 2015 12:06:58 -0400 Date: Tue, 6 Oct 2015 18:06:50 +0200 From: Peter Zijlstra To: Boqun Feng Cc: Oleg Nesterov , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Jonathan Corbet , Michal Hocko , David Howells , Linus Torvalds , Will Deacon Subject: Re: [PATCH] Documentation: Remove misleading examples of the barriers in wake_*() Message-ID: <20151006160650.GT3604@twins.programming.kicks-ass.net> References: <1441674841-11498-1-git-send-email-boqun.feng@gmail.com> <20150909192822.GM4029@linux.vnet.ibm.com> <20150910021612.GC18494@fixme-laptop.cn.ibm.com> <20150910175557.GA20640@redhat.com> <20150917130125.GL3816@twins.programming.kicks-ass.net> <20150924132121.GA1814@fixme-laptop.cn.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150924132121.GA1814@fixme-laptop.cn.ibm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2015 at 09:21:22PM +0800, Boqun Feng 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 and very helpful ;-) > > > So maybe we can reduce the description in memory-barriers to this > > 'split' program order guarantee, where a woken task must observe both > > its own prior state and its wakee state. > ^^^^^ > I think you mean "waker" here, right? Yes. > And the waker is not necessarily the same task who set the @cond to > true, right? It should be. > If so, I feel like it's really hard to *use* this 'split' > program order guarantee in other places than sleep/wakeup itself. Could > you give an example? Thank you. It was not meant to be used in any other scenario; the 'split' PO really is part of the whole sleep/wakeup. It does not apply to anything else.