lkml.org 
[lkml]   [2016]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: futex: clarification needed with drop_futex_key_refs and memory barriers
On Tue, 29 Mar 2016, Peter Zijlstra wrote:

>In any case; the below (completely irrelevant patch for you) is
>something I would propose. It gives hb_waiter_dec() RELEASE like
>semantics and ensures it cannot creep into the lock sections its
>typically behind. Although strictly speaking I think it being inside
>that lock region is sufficient.

Indeed, it should be sufficient. Racing with waiter decrements
(leaking into the hb critical region) is perfectly ok as the
consequence is that the reader thread will simply go take the lock
by not seeing the 1->0 dec, and therefore no harm done. Something that
0->1 cannot afford to rely on, obviously. So I think we can save the extra
barrier for the release semantics and keep the call relaxed, as the
performance penalty would be higher. Or are you referring to something else?

>
>It also re-orders the increment in requeue to happen before we add to
>the list (as is the proper order)

ack to this part -- should be a separate patch.

Thanks,
Davidlohr

\
 
 \ /
  Last update: 2016-04-02 09:01    [W:0.073 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site