]> asedeno.scripts.mit.edu Git - linux.git/commit
tools/memory-model: Remove duplicated code from lock.cat
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 14 May 2018 23:33:50 +0000 (16:33 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 15 May 2018 06:11:17 +0000 (08:11 +0200)
commit8559183ccaec97454b2515ac426f113967256cf9
tree6aee2f09189b0b9441ecfb3c399078158424fb71
parent1bd3742043fa44dd0ec25770abdcdfe1f6e8681e
tools/memory-model: Remove duplicated code from lock.cat

This patch simplifies the implementation of spin_is_locked in the
LKMM.  It capitalizes on the fact that a failed spin_trylock() and a
spin_is_locked() which returns True have exactly the same semantics
(those of READ_ONCE) and ordering properties (none).  Therefore the
two kinds of events can be combined and handled by the same code,
instead of treated separately as they are currently.

Tested-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Akira Yokosawa <akiyks@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jade Alglave <j.alglave@ucl.ac.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luc Maranget <luc.maranget@inria.fr>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arch@vger.kernel.org
Cc: parri.andrea@gmail.com
Link: http://lkml.kernel.org/r/1526340837-12222-12-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/memory-model/lock.cat