[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wgbnn7x+i72NqnvXotbxjsk2Ag56Q5YP0OSvhY9sUk7QA@mail.gmail.com>
Date: Mon, 4 Mar 2019 16:19:58 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: Nicholas Piggin <npiggin@...il.com>,
linux-arch <linux-arch@...r.kernel.org>,
Will Deacon <will.deacon@....com>,
Andrea Parri <andrea.parri@...rulasolutions.com>,
Arnd Bergmann <arnd@...db.de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Rich Felker <dalias@...c.org>,
David Howells <dhowells@...hat.com>,
Daniel Lustig <dlustig@...dia.com>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
"Maciej W. Rozycki" <macro@...ux-mips.org>,
Ingo Molnar <mingo@...nel.org>,
Palmer Dabbelt <palmer@...ive.com>,
Paul Burton <paul.burton@...s.com>,
"Paul E. McKenney" <paulmck@...ux.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Alan Stern <stern@...land.harvard.edu>,
Tony Luck <tony.luck@...el.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>
Subject: Re: [PATCH 01/20] asm-generic/mmiowb: Add generic implementation of
mmiowb() tracking
On Mon, Mar 4, 2019 at 2:24 AM Michael Ellerman <mpe@...erman.id.au> 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
Powered by blists - more mailing lists