public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <dave@stgolabs.net>
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 16:59:31 +0100	[thread overview]
Message-ID: <20160112155931.GM6357@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160112150946.GA1927@linux-uzut.site>

On Tue, Jan 12, 2016 at 07:09:46AM -0800, Davidlohr Bueso wrote:
> 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).

OK, fair enough.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

      reply	other threads:[~2016-01-12 15:59 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
2016-01-12 15:59     ` Peter Zijlstra [this message]

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=20160112155931.GM6357@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.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