Re: [PATCH v1] ACPI: OSL: Use usleep_range() in acpi_os_sleep()
From: Len Brown
Date: Tue Dec 10 2024 - 23:14:30 EST
On Thu, Dec 5, 2024 at 7:24 AM Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> wrote:
>
> Add at least 50 us on top of the requested sleep time in case the
> timer can be subject to coalescing, which is consistent with what's
> done in user space in this context [2], but for sleeps longer than 5 ms
> use 1% of the requested sleep time for this purpose.
>
> The rationale here is that longer sleeps don't need that much of a timer
> precision as a rule and making the timer a more likely candidate for
> coalescing in these cases is generally desirable. It starts at 5 ms so
> that the delta between the requested sleep time and the effective
> deadline is a contiuous function of the former.
timerslack_ns defaults to 50,000 ns.
So when a user invokes nanosleep(50ms), they get slacked out to 50.050 ms
With this patch, if the AML BIOS programmer invokes Sleep(50ms),
it gets slacked out to 50.500 ms -- a 10x longer slack period.
I have not seen an explanation for why these cases should be treated
differently.
Len Brown, Intel Open Source Technology Center