Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1540910
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH -v4 04/10] futex: Use smp_store_release() in mark_wake_futex() |
| Date | 2016-12-13 10:10 +0100 |
| Message-ID | <sNRfX-7LI-7@gated-at.bofh.it> (permalink) |
| References | <sNRfX-7LI-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Since the futex_q can dissapear the instruction after assigning NULL, this really should be a RELEASE barrier. That stops loads from hitting dead memory too. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- kernel/futex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1288,8 +1288,7 @@ static void mark_wake_futex(struct wake_ * memory barrier is required here to prevent the following * store to lock_ptr from getting ahead of the plist_del. */ - smp_wmb(); - q->lock_ptr = NULL; + smp_store_release(&q->lock_ptr, NULL); } static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *top_waiter,
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH -v4 04/10] futex: Use smp_store_release() in mark_wake_futex() Peter Zijlstra <peterz@infradead.org> - 2016-12-13 10:10 +0100 Re: [PATCH -v4 04/10] futex: Use smp_store_release() in mark_wake_futex() Darren Hart <dvhart@infradead.org> - 2016-12-17 02:00 +0100
csiph-web