From: Peter Zijlstra <peterz@infradead.org>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
1vier1@web.de, Oleg Nesterov <oleg@redhat.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Kirill Tkhai <ktkhai@parallels.com>,
Ingo Molnar <mingo@redhat.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] ipc/sem.c: Update/correct memory barriers
Date: Mon, 10 Aug 2015 10:15:52 +0200 [thread overview]
Message-ID: <20150810081552.GV16853@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1439142939-2605-1-git-send-email-manfred@colorfullife.com>
On Sun, Aug 09, 2015 at 07:55:39PM +0200, Manfred Spraul wrote:
> sem_lock() did not properly pair memory barriers:
>
> !spin_is_locked() and spin_unlock_wait() are both only control barriers.
> The code needs an acquire barrier, otherwise the cpu might perform
> read operations before the lock test.
> As no primitive exists inside <include/spinlock.h> and since it seems
> noone wants another primitive, the code creates a local primitive within
> ipc/sem.c.
>
> With regards to -stable:
> The change of sem_wait_array() is a bugfix, the change to sem_lock()
> is a nop (just a preprocessor redefinition to improve the readability).
> The bugfix is necessary for all kernels that use sem_wait_array()
> (i.e.: starting from 3.10).
>
> Andrew: Could you include it into your tree and forward it?
>
> Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
> Reported-by: Oleg Nesterov <oleg@redhat.com>
> Cc: <stable@vger.kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
next prev parent reply other threads:[~2015-08-10 8:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-09 17:55 [PATCH] ipc/sem.c: Update/correct memory barriers Manfred Spraul
2015-08-10 8:15 ` Peter Zijlstra [this message]
2015-08-12 13:31 ` Oleg Nesterov
-- strict thread matches above, loose matches on Subject: below --
2015-03-01 16:18 Manfred Spraul
2015-03-01 19:16 ` Oleg Nesterov
2015-02-28 20:36 Manfred Spraul
2015-02-28 21:45 ` Peter Zijlstra
2015-02-28 23:34 ` Paul E. McKenney
2015-03-01 13:28 ` Oleg Nesterov
2015-03-01 13:22 ` Oleg Nesterov
2015-03-01 16:07 ` Manfred Spraul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150810081552.GV16853@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=1vier1@web.de \
--cc=akpm@linux-foundation.org \
--cc=jpoimboe@redhat.com \
--cc=ktkhai@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox