Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1543872
| Path | csiph.com!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Darren Hart <dvhart@infradead.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH -v4 04/10] futex: Use smp_store_release() in mark_wake_futex() |
| Date | Sat, 17 Dec 2016 02:00:07 +0100 |
| Message-ID | <sPbw3-2nR-11@gated-at.bofh.it> (permalink) |
| References | <sNRfX-7LI-3@gated-at.bofh.it> <sNRfX-7LI-7@gated-at.bofh.it> |
| X-Original-To | Peter Zijlstra <peterz@infradead.org> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.7.1 (2016-10-04) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 51 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | tglx@linutronix.de, mingo@kernel.org, juri.lelli@arm.com, rostedt@goodmis.org, xlpang@redhat.com, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, bristot@redhat.com, paulmck@linux.vnet.ibm.com |
| X-Original-Date | Fri, 16 Dec 2016 16:50:45 -0800 |
| X-Original-Message-ID | <20161217005045.GG62123@f23x64.localdomain> |
| X-Original-References | <20161213083638.938898295@infradead.org> <20161213085730.289714424@infradead.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1543872 |
Show key headers only | View raw
On Tue, Dec 13, 2016 at 09:36:42AM +0100, Peter Zijlstra wrote: > 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. > +Paul McKenney Per the introduction of the comment below from: f1a11e0 futex: remove the wait queue I believe the intent was to ensure the plist_del in ... the previous __unqueue_futex(q) ... from getting ahead of the smp_store_release added here, which could result in q being destroyed by the waking task before plist_del can act on it. Is that right? The comment below predates the refactoring which hid plist_del under the __unqueue_futex() making it a bit less clear as to the associated plist_del: However, since this comment, we have moved the wake-up out of wake_futex through the use of wake queues (wake_up_q) which now happens after the hb lock is released (see futex_wake, futex_wake_op, and futex_requeue). Is this race still a valid concern? > 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, > > > -- Darren Hart Intel Open Source Technology Center
Back to linux.kernel | Previous | Next — Previous 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