Received: by 10.213.65.16 with SMTP id m16csp246309imf; Mon, 12 Mar 2018 02:14:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELu7PVXf0GjxtwQACwc4c6bxb4k9mJfryCzOTlKVh/SJCtNMX1wwNxSzxHqm8Qr4dfpZq9zT X-Received: by 10.101.74.208 with SMTP id c16mr6062344pgu.116.1520846076017; Mon, 12 Mar 2018 02:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520846075; cv=none; d=google.com; s=arc-20160816; b=1LO9SXOOuZTD6Gmk9TVwniewrPHkhmOfbtOZNMddWGFXiG5Lgk1e6A/N3mdw3o6B2R tb6TrB8plaYXqGH3BcFdKpcMkfyaLOT7fWHr/ppFyzJKOaoZttIJZxcZ8TRSrKMjf7rw qlRzXiRGPlmE2BDeaFeWyi49++dzHAgV775BaAvvtZFzAJCsOfuSTL1rWzMbtofI3e1p jWWAzBeNjBIbtUf9EKWeJqEf/AYnbp+Nqd7zsN5JQF1UMOKK+koAbsCA6zJ7CnsiUwn9 6lNxc9UeON68Q3akkYw1z6pVuQSqYZhkYndKgRjQWgGgRvCJZ4v1vQOZ8LfkuIupzeGS xlCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=JhN/uv/vRWS+cADi4i8E3Cukxd/cSWx2yBU9SubfEkE=; b=kjkPzEyi4q8bmH/s9/ITStMIFhL1bfGAdctdwia1xAYNrcNAso4Hya2ehGk/NIpppq C0RngFXcMwxTFh7Om+jwwl+lK+ZOjIvqXbcLjrC6bkd1L8xFIAxoKCVWjNlGAAPRjeXj 2xc5oKYpGfz2FwgHmjgUjNMpvkbpTAT3KwICuf9X8ti3awi6gTE2C+EzvjE8+bpSrd89 9me+x+9wmQl6kndWw2Z1O9iXuq9/AnaKognCTT5woeR5LUH7Yd9ZxCgPRD99RyMh/QGZ Y+qahxS/j2d4loMAvS4NCyqOuJETEiz9ytYgEuWKBpYAKAJrpCQYkAbmkSzWaMihFEUl mkBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L5R6+o43; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si1594161pgb.115.2018.03.12.02.14.21; Mon, 12 Mar 2018 02:14:35 -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=@gmail.com header.s=20161025 header.b=L5R6+o43; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbeCLJNF (ORCPT + 99 others); Mon, 12 Mar 2018 05:13:05 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:43740 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbeCLJNE (ORCPT ); Mon, 12 Mar 2018 05:13:04 -0400 Received: by mail-ot0-f194.google.com with SMTP id m22so14534937otf.10 for ; Mon, 12 Mar 2018 02:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JhN/uv/vRWS+cADi4i8E3Cukxd/cSWx2yBU9SubfEkE=; b=L5R6+o43DYiBvZnZG/pQ203rtckDL353Utl3gMQqn0PIPAxMf0MFT0veUaE8CnzVR2 6Cc/1iwS+CsM8vu7GfyI0Nb0jkQ7rPMHUvrhdl4P0Ibv1r5BTIHJNbylyZLqeBYYe4id Ax6t3yuQ7d77EL8+LDTXeeezpX1dNsFEiagEuziF9fSJtkTtN2PCD9x0vyhaUl8aaRnY EpbUdokEimw6g8Dn3XmXVp97lH2lOqtsNn6ugpgmmKKLwk7PoWNeDRhHvenBerDBKQN/ sDR/dqpIqQN4EPjw/vOgsMaRxbjzC+Gl6pQT+2QdDByaDkVBMzPSM79o8q8fRxp0hU9u iSUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JhN/uv/vRWS+cADi4i8E3Cukxd/cSWx2yBU9SubfEkE=; b=GnAi1vI55dzD6Me0oyq2RDCPQyVvY3JAT+LDYZ/7zmt7WxQe9/7Isoo7ARaAKT5uas tfgbSzvqoioJ3W/7h7Ci6p44Nr2PjEVt848Db4/AGxYeWSwM0nqbIeOzphDXU3f6NOjH X0hMglrDN7YyEo4jbqh1fdYogCBS92i/tFK2t/p6C8qQxD4rmQBnptgw16w5DqrfrKPn oQI3QA3IY903f12+eWer969Ycpb/7LPDE3qnGv9mGdBSwtNsoWZjB9eWD73oUgubZOc/ G1N0tMOphkTIS7NIGEA+NoJrk4ZxzByw4z8cyzK4B3tPbdDW2f7zm6DFnog1KCQEVlNQ 1dZQ== X-Gm-Message-State: AElRT7F4zLUZRbIl45MuucqIAB8bGxXbJov4AUx/z6CKWl5xc/h86bkB gIsZ4vnfKoUEl2ZU77OpWwbs+4KzSnVh3dCIMf4= X-Received: by 10.157.80.34 with SMTP id a34mr4616521oth.79.1520845983558; Mon, 12 Mar 2018 02:13:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.151.230 with HTTP; Mon, 12 Mar 2018 02:13:03 -0700 (PDT) In-Reply-To: <20180312085646.GE4064@hirez.programming.kicks-ass.net> References: <20180312054412.yqyde34ly3kjoajj@tardis> <20180312085600.aczjkpn73axzs2sb@tardis> <20180312085646.GE4064@hirez.programming.kicks-ass.net> From: =?UTF-8?B?54Sm5pmT5Yas?= Date: Mon, 12 Mar 2018 17:13:03 +0800 Message-ID: Subject: Re: smp_mb__after_spinlock requirement too strong? To: Peter Zijlstra Cc: Boqun Feng , linux-kernel@vger.kernel.org, Alan Stern , will.deacon@arm.com, torvalds@linux-foundation.org, npiggin@gmail.com, mingo@kernel.org, mpe@ellerman.id.au, oleg@redhat.com, benh@kernel.crashing.org, Paul McKenney Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 4:56 PM, Peter Zijlstra wrote: > On Mon, Mar 12, 2018 at 04:56:00PM +0800, Boqun Feng wrote: >> So I think the purpose of smp_mb__after_spinlock() is to provide RCsc >> locks, it's just the comments before that may be misleading. We want >> RCsc locks in schedule code because we want writes in different critical >> section are ordered even outside the critical sections, for case like: >> >> CPU 0 CPU 1 CPU 2 >> >> {A =0 , B = 0} >> lock(rq0); >> write A=1; >> unlock(rq0); >> >> lock(rq0); >> read A=1; >> write B=2; >> unlock(rq0); >> >> read B=2; >> smp_rmb(); >> read A=1; >> >> I think we need to fix the comments rather than loose the requirement. >> Peter? > > Yes, ISTR people relying on schedule() being RCsc, and I just picked a > bad exmaple. Hi, Peter, If the fixed comment could point out where this RCsc is used, it will be great.