Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state
- From: Eric Dumazet <edumazet@xxxxxxxxxx>
- Date: Thu, 7 Nov 2019 08:35:30 -0800
- Cc: LKML <linux-kernel@xxxxxxxxxxxxxxx>, linux-tip-commits@xxxxxxxxxxxxxxx, syzbot <syzkaller@xxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>
- In-reply-to: <20191107161149.GQ20975@paulmck-ThinkPad-P72>
- References: <20191106174804.74723-1-edumazet@google.com> <157307905904.29376.8711513726869840596.tip-bot2@tip-bot2> <CANn89iKXi3rWWruKoBwQ8rncwLvkbzjZJWuJL3K05fjAhcySwg@mail.gmail.com> <CANn89iL=xPxejRPC=wHY7q27fLOvFBK-7HtqU_HJo+go3S9UXA@mail.gmail.com> <20191107085255.GK20975@paulmck-ThinkPad-P72> <CANn89i+8Hq5j234zFRY05QxZU1n=Vr6S-kZCcvn3Z80xYaindg@mail.gmail.com> <20191107161149.GQ20975@paulmck-ThinkPad-P72>
On Thu, Nov 7, 2019 at 8:11 AM Paul E. McKenney <paulmck@xxxxxxxxxx> wrote:
>
> OK, so this is due to timer_pending() lockless access to ->entry.pprev
> to determine whether or not the timer is on the list. New one on me!
>
> Given that use case, I don't have an objection to your patch to list.h.
>
> Except...
>
> Would it make sense to add a READ_ONCE() to hlist_unhashed()
> and to then make timer_pending() invoke hlist_unhashed()? That
> would better confine the needed uses of READ_ONCE().
Sounds good to me, I had the same idea but was too lazy to look at the
history of timer_pending()
to check if the pprev pointer check was really the same underlying idea.
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]