mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuai Xue <xueshuai@linux.alibaba.com>
To: me@ahmedabdelfattah.dev, "Rafael J. Wysocki" <rafael@kernel.org>,
	Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	Hanjun Guo <guohanjun@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Ying Huang <huang.ying.caritas@gmail.com>,
	Andi Kleen <ak@linux.intel.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: APEI: GHES: Poll error sources at their poll interval
Date: Tue, 24 Nov 2026 09:49:58 +0800	[thread overview]
Message-ID: <115ef051-31c1-4201-b60d-bfea9d413bd8@linux.alibaba.com> (raw)
In-Reply-To: <20261119-acpi-ghes-poll-interval-v1-1-6f45cc65fd62@ahmedabdelfattah.dev>



On 11/20/26 2:36 AM, Ahmed Abdelfattah via B4 Relay wrote:
> From: Ahmed Abdelfattah <me@ahmedabdelfattah.dev>
> 
> 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@ahmedabdelfattah.dev>
> ---
> 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@linux.alibaba.com>

Thanks.
Shuai

      parent reply	other threads:[~2026-11-24  1:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 18:36 Ahmed Abdelfattah via B4 Relay
2026-11-23 16:16 ` Andi Kleen
2026-11-24  1:49 ` Shuai Xue [this message]

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=115ef051-31c1-4201-b60d-bfea9d413bd8@linux.alibaba.com \
    --to=xueshuai@linux.alibaba.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=guohanjun@huawei.com \
    --cc=huang.ying.caritas@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=me@ahmedabdelfattah.dev \
    --cc=rafael@kernel.org \
    --cc=tony.luck@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®