[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191013154748.GG13278@amd>
Date: Sun, 13 Oct 2019 17:47:48 +0200
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Li RongQing <lirongqing@...du.com>,
Liang ZhiCheng <liangzhicheng@...du.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 4.19 032/114] timer: Read jiffies once when forwarding
base clk
On Thu 2019-10-10 10:35:39, Greg Kroah-Hartman wrote:
> From: Li RongQing <lirongqing@...du.com>
>
> commit e430d802d6a3aaf61bd3ed03d9404888a29b9bf9 upstream.
>
> The reason is that the code in collect_expired_timers() uses jiffies
> unprotected:
>
> if (next_event > jiffies)
> base->clk = jiffies;
>
> As the compiler is allowed to reload the value base->clk can advance
> between the check and the store and in the worst case advance farther than
> next event. That causes the timer expiry to be delayed until the wheel
> pointer wraps around.
>
> Convert the code to use READ_ONCE()
Does it really need to use READ_ONCE? "jiffies" is already volatile,
READ_ONCE just adds another volatile...
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists