Re: [PATCH 2/2] ipc/sem.c: Remove duplicated memory barriers.

From: Manfred Spraul
Date: Wed Jul 13 2016 - 14:38:15 EST


Hi Davidlohr,

On 07/13/2016 06:16 PM, Davidlohr Bueso wrote:
Manfred, shouldn't this patch be part of patch 1 (as you add the unnecessary barriers there? Iow, can we have a single patch for all this?

Two reasons:
- patch 1 is safe for backporting, patch 2 not.
- patch 1 is safe on all architectures, for patch 2 I would like to get some review feedback.

e.g. I just found/read 51d7d5205d33 ("powerpc: Add smp_mb() to arch_spin_is_locked()"):
For powerpc, a smp_mb() was added into spin_is_locked(), more or less for ipc/sem.c.

Patch 1 replaces the spin_is_locked() with smp_load_acquire().
Isn't that the proof that smp_mb() is required?



--
Manfred