Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2854707imb; Mon, 4 Mar 2019 16:21:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IbbAVkCx91fvGfmbx2Z8azHF+JSXdw8MKO2NQOBhxSAE5hKfhA17TUjxQhb690uwOQsU6GN X-Received: by 2002:a62:6ec3:: with SMTP id j186mr23397866pfc.89.1551745279704; Mon, 04 Mar 2019 16:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551745279; cv=none; d=google.com; s=arc-20160816; b=BmSThvv8CYVZCoNSg2SMvbtwaVW0PkSK1+LbVSZdKPudtAsOcC3mm+oJ4kWlE3gecX WRTDtYwsfSooWLhmWZKXXACCmyzxlqE5vBHslFSAFGS69LVGszZ603wmiigY+SQpQlDQ FosqIGEKjjTzUiqtktUGLk7AUotizOZn0Vbfau6tXmbyNk1eUqVy6RGSH4OgtL7SLrNs rEOTqNKdVs3QSulpRhU6k1F0V5sSU7hPEGbXulQn1Cou0V8i0cZCvQQJ85JScagBFazu Wn1mPOdY8Aqj2iwXqAfk8DcLG0RgFmulrGItv4JJbJEetc4dZfPzWNJDsqIOOMfH4tin AYVg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=X10NlC/byk7JQjbMFCtGWNvV4jecMH5AY93C/xcjuGM=; b=MSzrQwTKtuG7nmmBYdTj6JrNrGxI17uYtsOCwE+yr+yvWAkKCURtGUdJRVQD09Vagc SzzMnvPz2sm4fas/jLxXZWW9QdFtHiw+de5+Ne+lwDaJYz3fpJln0fB+oYH8dIEIdwyJ azPIoIiWpHP2yd/xN2UsOBDtlh2dK+JCKHG1kFh0kxjErPo+DPzdxGDoUrwvIcpBrp/E 73kXG6johbZ78lhQTTOTN+MssjNH9qFSsrziOyv5yksfEyoTixwyocTM0qwqcZABpKxq B8PFLWh9xGCkIQ4OXGUVMtl77hjBC/BP7lRtUjq0cXF2473feg/nUzHo2gVCRxdVB4hK nisA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=WzW8o8sf; 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 n79si6666416pfb.133.2019.03.04.16.21.04; Mon, 04 Mar 2019 16:21:19 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=WzW8o8sf; 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 S1726716AbfCEAUU (ORCPT + 99 others); Mon, 4 Mar 2019 19:20:20 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:43516 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbfCEAUT (ORCPT ); Mon, 4 Mar 2019 19:20:19 -0500 Received: by mail-lf1-f65.google.com with SMTP id p73so4249830lfe.10 for ; Mon, 04 Mar 2019 16:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X10NlC/byk7JQjbMFCtGWNvV4jecMH5AY93C/xcjuGM=; b=WzW8o8sfpWeM0HYBmZ5Lro5cTKVH0PEgVd5Hwm1VjO+eVuIPRTPKeqBQhANBjroAao EhAERH/wyavYctXDp2ZphlVz4lh/X/3k7/2dCO4WCplgeFG1zeu3wxzFOBs0XZn7cU1g I7tHOalb8BHZjmN+cmewwRmCsM+pRTe94b0eA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X10NlC/byk7JQjbMFCtGWNvV4jecMH5AY93C/xcjuGM=; b=AdH5g/R4kgcukpH4+b0YlqqXEA352uH+q1T+anLMnTTEJZZc8rdQo3wurPxW7J1n5v k02vA+kuf8bDyC3JYLQCaJgJOYStK92Vuq7Kv3AdrtAgub/nnGaiA7i42/p3l0da1Dgf hA+e5rF9XhBKHOqj/HFEXZQ52Kd94cR8imFX0fupZT3R2lBDlimsKWGrafFcJCed1lco 2MgwhT0npRHGuzsPJlCe7IhM8Cm3Yg9LQW3nMwO5EGbMOsHXMaCRFIhtDFpTpSFyKGNj OtAZV+Dv4PXCAxxJxiNvRoxPuZJrtesOAnAN991jLKPSF0EY1gZhZblm64fZSrk8Lm5Y l1hw== X-Gm-Message-State: APjAAAUQthgIgxC7lyYFW/U6Vd9fQcMQtxAj0V4YFjxGoNELUGEkOJOO isuvsqx2awiWwnfUC37jl4Xh/vfmp9c= X-Received: by 2002:ac2:4142:: with SMTP id c2mr3510992lfi.84.1551745217706; Mon, 04 Mar 2019 16:20:17 -0800 (PST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id q12sm1770841lfc.8.2019.03.04.16.20.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 16:20:15 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id d26so4862258lfa.1 for ; Mon, 04 Mar 2019 16:20:14 -0800 (PST) X-Received: by 2002:a19:4ac4:: with SMTP id x187mr12125075lfa.166.1551745214041; Mon, 04 Mar 2019 16:20:14 -0800 (PST) MIME-Version: 1.0 References: <20190301140348.25175-1-will.deacon@arm.com> <20190301140348.25175-2-will.deacon@arm.com> <1551575210.6lwpiqtg5k.astroid@bobo.none> <87ef7n7x9v.fsf@concordia.ellerman.id.au> In-Reply-To: <87ef7n7x9v.fsf@concordia.ellerman.id.au> From: Linus Torvalds Date: Mon, 4 Mar 2019 16:19:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 01/20] asm-generic/mmiowb: Add generic implementation of mmiowb() tracking To: Michael Ellerman Cc: Nicholas Piggin , linux-arch , Will Deacon , Andrea Parri , Arnd Bergmann , Benjamin Herrenschmidt , Rich Felker , David Howells , Daniel Lustig , Linux List Kernel Mailing , "Maciej W. Rozycki" , Ingo Molnar , Palmer Dabbelt , Paul Burton , "Paul E. McKenney" , Peter Zijlstra , Alan Stern , Tony Luck , Yoshinori Sato 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 4, 2019 at 2:24 AM Michael Ellerman wrote: > > Without wading into the rest of the discussion, this does raise an > interesting point, ie. what about eg. rwlock's? > > They're basically equivalent to spinlocks, and so could reasonably be > expected to have the same behaviour. > > But we don't check the io_sync flag in arch_read/write_unlock() etc. and > both of those use lwsync. I think technically rwlocks should do the same thing, at least when they are used for exclusion. Because of the exclusion argument, we can presubably limit it to just write_unlock(), although at least in theory I guess you could have some "one reader does IO, then a writer comes in" situation.. Perhaps more importantly, what about sleeping locks? When they actually *block*, they get the barrier thanks to the scheduler, but you can have a nice non-contended sequence that never does that. I guess the fact that these cases have never even shown up as an issue means that we could just continue to ignore it. We could even give that approach some fancy name, and claim it as a revolutionary new programming paradigm ("ostrich programming" to go with "agile" and "pair programming"). Linus