mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Eric Dumazet <edumazet@google.com>, Will Deacon <will@kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: Confused about hlist_unhashed_lockless()
Date: Fri, 31 Jan 2020 12:52:04 -0800	[thread overview]
Message-ID: <20200131205204.GT2935@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <87blqj4ddg.fsf@nanos.tec.linutronix.de>

On Fri, Jan 31, 2020 at 08:47:23PM +0100, Thomas Gleixner wrote:
> Eric Dumazet <edumazet@google.com> writes:
> > On Fri, Jan 31, 2020 at 9:21 AM Will Deacon <will@kernel.org> wrote:
> >> Without serialisation, timer_pending() as currently implemented does
> >> not reliably tell you whether the timer is in the hlist. Is that not a
> >> problem?
> >
> > No it is not a problem.
> 
> Even if we would take the base lock then this is just a snapshot, which
> can be wrong at the moment the lock is dropped. So why bother?

The risk of leaving it as-is or of using data_race() is that if it is
checked multiple times, the compiler might use the old value.  Yes,
we could say that things like barrier() should be used in those cases,
but READ_ONCE() has the advantage of making it so that no one has to
worry about those cases.

							Thanx, Paul

  reply	other threads:[~2020-01-31 20:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 16:43 Will Deacon
2020-01-31 16:48 ` Eric Dumazet
2020-01-31 16:57   ` Will Deacon
2020-01-31 17:06     ` Eric Dumazet
2020-01-31 17:20       ` Will Deacon
2020-01-31 17:33         ` Eric Dumazet
2020-01-31 18:32           ` Will Deacon
2020-01-31 19:47           ` Thomas Gleixner
2020-01-31 20:52             ` Paul E. McKenney [this message]
2020-01-31 18:43   ` Peter Zijlstra
2020-01-31 18:48     ` Eric Dumazet
2020-01-31 18:52       ` Eric Dumazet
2020-01-31 20:53         ` Paul E. McKenney
2020-01-31 21:04           ` Eric Dumazet
2020-01-31 21:19             ` Paul E. McKenney
2020-02-03 15:45         ` David Laight
2020-02-03 15:54           ` Marco Elver
2020-02-03 16:05             ` David Laight
2020-02-03 17:25               ` Paul E. McKenney
2020-02-03 15:58           ` Paul E. McKenney
2020-02-03 16:02             ` Will Deacon
2020-02-03 17:29               ` Paul E. McKenney
2020-02-03 18:27                 ` Will Deacon
2020-02-03 21:16                   ` Paul E. McKenney
2020-01-31 19:20       ` Marco Elver
2020-01-31 18:52   ` Paul E. McKenney
2020-01-31 18:55     ` Eric Dumazet

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=20200131205204.GT2935@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@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

all inboxes | Powered by JetHome®