Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 6 Nov 2019, Eric Dumazet wrote:
> > -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.

Yes, I'm a moron....




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux