[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <abcae6c7-6269-94e0-3e66-b7d07fbe10dc@colorfullife.com>
Date: Tue, 9 Aug 2016 20:52:27 +0200
From: Manfred Spraul <manfred@...orfullife.com>
To: Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Davidlohr Bueso <davidlohr@...com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Susi Sonnenschein <1vier1@....de>
Subject: spin_lock implicit/explicit memory barrier
Hi Benjamin, Hi Michael,
regarding commit 51d7d5205d33 ("powerpc: Add smp_mb() to
arch_spin_is_locked()"):
For the ipc/sem code, I would like to replace the spin_is_locked() with
a smp_load_acquire(), see:
http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n367
http://www.ozlabs.org/~akpm/mmots/broken-out/ipc-semc-fix-complex_count-vs-simple-op-race.patch
To my understanding, I must now add a smp_mb(), otherwise it would be
broken on PowerPC:
The approach that the memory barrier is added into spin_is_locked()
doesn't work because the code doesn't use spin_is_locked().
Correct?
--
Manfred
Powered by blists - more mailing lists