Re: [PATCH] ACPI: APEI: GHES: Poll error sources at their poll interval

From: Rafael J. Wysocki (Intel)

Date: Wed Nov 25 2026 - 13:53:55 EST


On Tue, Nov 24, 2026 at 2:50 AM Shuai Xue <xueshuai@xxxxxxxxxxxxxxxxx> wrote:
>
>
>
> On 11/20/26 2:36 AM, Ahmed Abdelfattah via B4 Relay wrote:
> > From: Ahmed Abdelfattah <me@xxxxxxxxxxxxxxxxxxxx>
> >
> > ghes_add_timer() passes an absolute time to round_jiffies_relative(),
> > which takes a delay:
> >
> > expire = jiffies + msecs_to_jiffies(g->notify.poll_interval);
> > ghes->timer.expires = round_jiffies_relative(expire);
> >
> > round_jiffies_relative(j) rounds jiffies + j to a whole second and
> > subtracts jiffies again, so what gets rounded here is 2 * jiffies plus
> > the interval, and the timer fires up to a second away from the Poll
> > Interval in the HEST. With a 1000 ms interval, on some boots the polls
> > come every 1.5 s on average, for seconds or for minutes, and the rest
> > of the time they are anywhere from 0.75 s to 1.95 s apart. A 250 ms
> > source settles at one poll a second.
> >
> > Rounding the delay instead would still move every interval that is not
> > a whole number of seconds; a 250 ms source would still be polled once a
> > second. Drop the rounding and use the interval as it is.
> >
> > Fixes: 81e88fdc432a ("ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support")
> > Signed-off-by: Ahmed Abdelfattah <me@xxxxxxxxxxxxxxxxxxxx>
> > ---
> > I found this while timing a polled GHES in a QEMU guest, with a HEST
> > built for the test (one polled GHESv2) and given to the guest as an
> > extra ACPI table.
> >
> > Tested on v7.4-rc3+ (4405c18c95d2) at HZ=300, tracing ghes_poll_func()
> > with a kprobe. With a 1000 ms Poll Interval and without the patch, the
> > intervals on three 10-minute boots ranged from 0.77 s to 1.95 s: one
> > boot averaged 1.5 s for its first two minutes, and the others
> > alternated between 280 and 320 jiffies, and between 240 and 360. With
> > the patch, every interval on three 3-minute boots was 304 jiffies
> > (1.013 s). With a 250 ms Poll Interval, the polls settled at about one
> > a second within the first minute without the patch; with it they come
> > every 80 jiffies (267 ms). The extra 4 and 5 jiffies are the timer
> > wheel's granularity at those timeouts.
> > ---
> > drivers/acpi/apei/ghes.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> > index 5d888c82efea..92d54c6b209a 100644
> > --- a/drivers/acpi/apei/ghes.c
> > +++ b/drivers/acpi/apei/ghes.c
> > @@ -1276,7 +1276,7 @@ static void ghes_add_timer(struct ghes *ghes)
> > return;
> > }
> > expire = jiffies + msecs_to_jiffies(g->notify.poll_interval);
> > - ghes->timer.expires = round_jiffies_relative(expire);
> > + ghes->timer.expires = expire;
> > add_timer(&ghes->timer);
> > }
> >
>
> LGTM.
>
> Reviewed-by: Shuai Xue <xueshuai@xxxxxxxxxxxxxxxxx>

Applied as 7.5 material, thanks!