Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3681509imm; Mon, 25 Jun 2018 02:51:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKCkoUjkjHoVi3NxHd+wzUfCb98Aw0aNUcptuGbbmvP5B4VC6blHEZOfcDysb/LP1UkVx5A X-Received: by 2002:a63:7252:: with SMTP id c18-v6mr9827091pgn.186.1529920311722; Mon, 25 Jun 2018 02:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529920311; cv=none; d=google.com; s=arc-20160816; b=rJdoyAz82HGB/MD/2CTKEZMykHpC8maxDfbStFUaTqmOXDYvWLk6Toe2xKZMMG3L34 ALOUc44Bk5csfQc8OQuNEHw1HGumnycmYBVKUfjTF70GECEeizQ5jOZ1QMUw1L5NUGcb 875yj7yhFUyexjRlihWpmN7tZMl3W5y4qbmQQqJwpuSC/+nWQUUzYaecVjVlJJ4GNRDH E4L8BHkWSSR01EOVMyMOwLKjnfSzP1Btj82aJ7F6u3B6fm70surbAhNQp0qpOX5LHGT/ Po8Jfeei5h2QxHF+I0lafO9xG0iW4N0fH6AZisB5nlQTdQeRHDOrvflJEp4MmDW+wGRM IHOA== 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=WwlG8w8T3e9RqPUhmyd4u81FqB0MnXxew8C2ERjsbQk=; b=aXX8saXFBTYHUuZ5H3Rhp3v72uMejOSQZZL55rB9PyRGz/CjcuTnufPJ9BaDRiFQnr xLHlzu7ue36ZvZaV4aJ8YO8laXiQbyAoQ6dfzDu6kNbhXFruJLLS6qSE50cxdKKOQdaS Lmqb/29s0ecEIkRJ+TD/hWCGkhS9LJlrJflW3EKlSflEGQDDcsbmUXOBh1atvlz5R2Rj Jxt93x26T6DIIi4/03HvAZ996WcEeIM1SVFHBT+DVticm+MlJIfLOIqI4M4Crf/1Mp7t eIS5dU/SM6YII/JwdKkPAx+pcRuyecBc/Zt/L7sa4737HWD7Nf5lGj2NwyctF4+4x54f yyKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=n1swV0yu; 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 u6-v6si13741339pld.74.2018.06.25.02.51.37; Mon, 25 Jun 2018 02:51:51 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=n1swV0yu; 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 S1755179AbeFYJu5 (ORCPT + 99 others); Mon, 25 Jun 2018 05:50:57 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47390 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754866AbeFYJuz (ORCPT ); Mon, 25 Jun 2018 05:50:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WwlG8w8T3e9RqPUhmyd4u81FqB0MnXxew8C2ERjsbQk=; b=n1swV0yufzmnZJQeiiOW4xJOg KGMG9Qo1xtoCyI9He8M0fmD52eiWkDF7+pd/7ZLAqZjixrmzbLnyEuo2mYI9A8g5/Lc+Q3xQB8Slc BILkxQJwZP8hnz4+UeBYzZW5c0YSmmGh++N8W1L4g+kN19hYbH8r+AwiOxDoje5I273sm8QVaVIOh B90nK4Pq5YRCBoRvf/sLYiPPtHi9xbOHsHJ792fLXVR4RtESoZFxaaibXoYSrdNvZJLdrRRkqLxJt 8kXMmR27tQEL09pE0pbsjseK6LGuJIxwCX3jfVoQG4ZJxDMpzv9ozg7V3Yaohh6LFNF/VaCl6B63Y WnFre+khg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXO8n-0006uS-1q; Mon, 25 Jun 2018 09:50:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 86A922029F1D7; Mon, 25 Jun 2018 11:50:31 +0200 (CEST) Date: Mon, 25 Jun 2018 11:50:31 +0200 From: Peter Zijlstra To: Andrea Parri 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: <20180625095031.GX2494@hirez.programming.kicks-ass.net> References: <1529918258-7295-1-git-send-email-andrea.parri@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529918258-7295-1-git-send-email-andrea.parri@amarulasolutions.com> User-Agent: Mutt/1.10.0 (2018-05-17) 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: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. 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?