All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: linux-tip-commits@vger.kernel.org,
	syzbot <syzkaller@googlegroups.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>
Subject: Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state
Date: Wed, 6 Nov 2019 14:02:55 -0800	[thread overview]
Message-ID: <CANn89iKBaEdCzgF-MT1wrxBZtBD2Ktr9qeThTG_XKOy742XcmQ@mail.gmail.com> (raw)
In-Reply-To: <157307438959.29376.9644507314555163943.tip-bot2@tip-bot2>

On Wed, Nov 6, 2019 at 1:06 PM tip-bot2 for Eric Dumazet
<tip-bot2@linutronix.de> wrote:
>
> The following commit has been merged into the timers/core branch of tip:
>
> Commit-ID:     de4db39b9f0e682e59caa828a277632510901560
> Gitweb:        https://git.kernel.org/tip/de4db39b9f0e682e59caa828a277632510901560
> Author:        Eric Dumazet <edumazet@google.com>
> AuthorDate:    Wed, 06 Nov 2019 09:48:04 -08:00
> Committer:     Thomas Gleixner <tglx@linutronix.de>
> CommitterDate: Wed, 06 Nov 2019 21:59:56 +01:00
>
> hrtimer: Annotate lockless access to timer->state

...

> -/*
> - * Helper function to check, whether the timer is on one of the queues
> +/**
> + * hrtimer_is_queued = check, whether the timer is on one of the queues
> + * @timer:     Timer to check
> + *
> + * Returns: True if the timer is queued, false otherwise
> + *
> + * The function can be used lockless, but it gives only a current snapshot.
>   */
> -static inline int hrtimer_is_queued(struct hrtimer *timer)
> +static inline bool hrtimer_is_queued(struct hrtimer *timer)
>  {
> -       return timer->state & HRTIMER_STATE_ENQUEUED;
> +       /* The READ_ONCE pairs with the update functions of timer->state */
> +       return !!READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED;

You probably meant :

return !!(READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED);

Sorry for not spotting this earlier.

  reply	other threads:[~2019-11-06 22:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 17:48 [PATCH] hrtimer: Annotate lockless access to timer->state Eric Dumazet
2019-11-06 18:09 ` Thomas Gleixner
2019-11-06 18:19   ` Eric Dumazet
2019-11-06 19:15     ` Thomas Gleixner
2019-11-06 20:00       ` Eric Dumazet
2019-11-06 21:06 ` [tip: timers/core] " tip-bot2 for Eric Dumazet
2019-11-06 22:02   ` Eric Dumazet [this message]
2019-11-06 22:16     ` Thomas Gleixner
2019-11-06 22:24 ` tip-bot2 for Eric Dumazet
2019-11-06 22:53   ` Eric Dumazet
2019-11-06 22:59     ` Eric Dumazet
2019-11-07  8:52       ` Paul E. McKenney
2019-11-07 15:48         ` Eric Dumazet
2019-11-07 16:11           ` Paul E. McKenney
2019-11-07 16:35             ` Eric Dumazet
2019-11-07 16:39               ` Eric Dumazet
2019-11-07 16:54                 ` Paul E. McKenney
2019-11-07 16:59                   ` Eric Dumazet
2019-11-07 17:07                     ` Paul E. McKenney

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=CANn89iKBaEdCzgF-MT1wrxBZtBD2Ktr9qeThTG_XKOy742XcmQ@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.