Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3740019imm; Mon, 25 Jun 2018 03:57:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLeunw+3Me96keaPURV/TfNBT1dNcmjhkF2lBIkPOaSJRBjnP2V1ejKeVC9gVhjUb+afgPJ X-Received: by 2002:a62:10c2:: with SMTP id 63-v6mr12284512pfq.229.1529924252483; Mon, 25 Jun 2018 03:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529924252; cv=none; d=google.com; s=arc-20160816; b=XRdJqV09L8rOPMQ5sXibF2rskzSPsGnU/9inLYW61OKFCQmBbvgg1Xj6A0Xa0zCTVR AgYQPLcCJxwqBNteHk1vMsxMQQy1I5SoQSGRh30LYC2UYCUmSXdCP7OLB4d3bLAYi/Xm 3P6eW+fRKCez91RPhPmfSn9+arrFc38Nc5LJOkHarqxPOO3Z9JuY4Kg5jkyst1pJjIHu x8BYLgxRF3zxCyEUUQBHxxVLkgUjkndOnH5Ygq5paXI/C04mxmkli5zbsW8cxVVjm16E WU8a83Xk8xKupPKr/HMEF7PYteVWjnnd98BkTJ4S2L2PVcH5vaUj8r/CqsQJ3NnSkPCu fBdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=6ogIL3yb10eO2zBiNP7tMLo5NgpmJiRLveQpIw8LnwQ=; b=yilh9CaU/MHagUkRVbi5fJbgCK+zJpiWh5UwHiRTvKT0sXLcXeP9vHid0FYRzmysVe k9pZCfNSyJ7xpiVTFU5StM28kqvqf/hfLGRQ01IiUxai6NMUoSUrhpDH1PSi+mDlTIsD mXzNFsa/gwSfhb/UE2Pd5EU6619ap2D/1hyMWKANXx/M4QOoeXI1efDRDs33l5J9c6e5 J1uWYFGea3Qx/yqXbIJZ35JCmuaehULHJHMpG6B9YF/eYiTYTVZqJT4Sjeo6W4CEp7+F gO5G7qoDfFJaWjjF3alLMsC6hGNz9Zw4XgJBYewzf8QRtBf4y7fdnKMCoLPBoQM9qrVM pQew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JmxALotu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19-v6si6379290pgb.196.2018.06.25.03.57.17; Mon, 25 Jun 2018 03:57:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JmxALotu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932169AbeFYK4a (ORCPT + 99 others); Mon, 25 Jun 2018 06:56:30 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:50367 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755260AbeFYK41 (ORCPT ); Mon, 25 Jun 2018 06:56:27 -0400 Received: by mail-wm0-f68.google.com with SMTP id e16-v6so8721689wmd.0 for ; Mon, 25 Jun 2018 03:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6ogIL3yb10eO2zBiNP7tMLo5NgpmJiRLveQpIw8LnwQ=; b=JmxALotuvuzgm79cZrw6w2bccRM9Ie0LwgV9ODrjKWtmYx46r3QkOKhySl0ZAHXoKj 8pcRM/MmFo5tLJ+kBuJpq/V7eHwIV3DV+rZsSuYwvddHzlHwRTYCIpt2HRwtLMPAdPMC XaP544AFeoa9Z9iEfh2/L3HJcBh+beeVp/BEQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6ogIL3yb10eO2zBiNP7tMLo5NgpmJiRLveQpIw8LnwQ=; b=KKs+e68UJcferJB9Ex8akVPE5D3UpnhEZMeGGprsjHDXtJQAhOF/GoL1sfsLJryCx5 qafcuqBBWkZLhL54x6M0yjvNRJvz62L5NYfB79kXNBcr4dg9ahoQMzbX2XFlGpBOcRAN Cku46bZbNUqXjmwboZemxHs/vCb+neR5QFIBxLTAsCj9P2HBlfN1iii29+sQB1etzLJD fWXhFaToMTFM4bSM/vluPV0Klgb7kW9eQMF6qLyGZAX/loqvctL5G5+YgE+flnp0PmLQ 3hbVfLnoNBSK3U6Klmq+c4paOjffYs7ytqAmaRcSTZ6UPo2q+PtGTh0Qu208p9sinRZf qWCw== X-Gm-Message-State: APt69E3EiHKoDgER3U3KXljEbTif5+or2RX6joj5LtxDuq0aAXXQHLLX TEgQR2Cn5AIKZ2LTSgOCrTLe8Q== X-Received: by 2002:a1c:470b:: with SMTP id u11-v6mr579642wma.49.1529924186181; Mon, 25 Jun 2018 03:56:26 -0700 (PDT) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id q17-v6sm15149427wrs.5.2018.06.25.03.56.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 03:56:25 -0700 (PDT) Date: Mon, 25 Jun 2018 12:56:18 +0200 From: Andrea Parri To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Alan Stern , Will Deacon , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , Ingo Molnar , Randy Dunlap Subject: Re: [PATCH] doc: Update wake_up() & co. memory-barrier guarantees Message-ID: <20180625105618.GA12676@andrea> References: <1529918258-7295-1-git-send-email-andrea.parri@amarulasolutions.com> <20180625095031.GX2494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180625095031.GX2494@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 11:50:31AM +0200, Peter Zijlstra wrote: > On Mon, Jun 25, 2018 at 11:17:38AM +0200, Andrea Parri wrote: > > Both the implementation and the users' expectation [1] for the various > > wakeup primitives have evolved over time, but the documentation has not > > kept up with these changes: brings it into 2018. > > I wanted to reply to this saying that I'm not aware of anything relying > on this actually being a smp_mb() and that I've been treating it as an > RELEASE. > > But then I found my own comment that goes with smp_mb__after_spinlock(), > which explains why we do in fact need the transitive thing if I'm not > mistaken. A concrete example being the store-buffering pattern reported in [1]. > > So yes, I suppose we're entirely suck with the full memory barrier > semantics like that. But I still find it easier to think of it like a > RELEASE that pairs with the ACQUIRE of waking up, such that the task > is guaranteed to observe it's own wake condition. > > And maybe that is the thing I'm missing here. These comments only state > that it does in fact imply a full memory barrier, but do not explain > why, should it? "code (people) is relying on it" is really the only "why" I can think of. With this patch, that same/SB pattern is also reported in memory -barriers.txt. Other ideas? Andrea