From: Davidlohr Bueso <dave@stgolabs.net>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT
Date: Tue, 12 Jan 2016 07:09:46 -0800 [thread overview]
Message-ID: <20160112150946.GA1927@linux-uzut.site> (raw)
In-Reply-To: <20160112090629.GO6344@twins.programming.kicks-ass.net>
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
next prev parent reply other threads:[~2016-01-12 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 18:22 [PATCH] rbtree: use READ_ONCE in RB_EMPTY_ROOT Davidlohr Bueso
2016-01-12 9:06 ` Peter Zijlstra
2016-01-12 15:09 ` Davidlohr Bueso [this message]
2016-01-12 15:59 ` Peter Zijlstra
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=20160112150946.GA1927@linux-uzut.site \
--to=dave@stgolabs.net \
--cc=akpm@linux-foundation.org \
--cc=dbueso@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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