Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1307527

Re: [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT

From Davidlohr Bueso <dave@stgolabs.net>
Newsgroups linux.kernel
Subject Re: [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT
Date 2016-01-12 16:20 +0100
Message-ID <qQ8TM-2LK-21@gated-at.bofh.it> (permalink)
References <qPPo6-67U-19@gated-at.bofh.it> <qQ37I-7fJ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 12 Jan 2016, Peter Zijlstra wrote:

>On Mon, Jan 11, 2016 at 10:22:43AM -0800, Davidlohr Bueso wrote:
>> With d72da4a4d97 (rbtree: Make lockless searches non-fatal) our rbtrees
>> provide weak guarantees that allows us to do lockless (and very speculative)
>> reads of the tree. Such readers cannot see partial stores on nodes, ie
>> left/right as well as root. As such, similar to the WRITE_ONCE semantics when
>> doing rotations, use READ_ONCE when checking the root node in RB_EMPTY_ROOT.
>
>No objection, but is this actually used anywhere?

I found this because I wanted to use the waiter check in rtmutexes in a lockless
fashion (ie rt_mutex_has_waiters).

>
>Or is this a just-in-case completeness thing?

This too.

Thanks,
Davidlohr

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT Davidlohr Bueso <dave@stgolabs.net> - 2016-01-11 19:30 +0100
  Re: [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT Peter Zijlstra <peterz@infradead.org> - 2016-01-12 10:10 +0100
    Re: [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT Davidlohr Bueso <dave@stgolabs.net> - 2016-01-12 16:20 +0100
      Re: [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT Peter Zijlstra <peterz@infradead.org> - 2016-01-12 17:00 +0100

csiph-web