[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0is4gRauBZUVBHvSzDUXFz-6+B1TW+E_w6C4_DbQN-BfA@mail.gmail.com>
Date: Wed, 20 Nov 2024 20:27:33 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Len Brown <lenb@...nel.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Arjan van de Ven <arjan@...ux.intel.com>, anna-maria@...utronix.de,
tglx@...utronix.de, peterz@...radead.org, frederic@...nel.org, corbet@....net,
akpm@...ux-foundation.org, linux-acpi@...r.kernel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Len Brown <len.brown@...el.com>, Todd Brandt <todd.e.brandt@...el.com>
Subject: Re: [PATCH v2] ACPI: Replace msleep() with usleep_range() in acpi_os_sleep().
On Wed, Nov 20, 2024 at 7:55 PM Len Brown <lenb@...nel.org> wrote:
>
> On Wed, Nov 20, 2024 at 1:50 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
>
> > > 50 usec is likely more than enough in practice.
> >
> > And would you use the same slack value regardless of the sleep
> > duration, or make it somehow depend on the sleep duration?
>
> timerslack_ns is 50 usec for all user-space, no matter the duration.
>
> This part was done right -- it doesn't depend on the sleep duration.
>
> Coalescing depends on the pattern of wakeups over time.
So say there are two tasks that each sleep for 5 ms every 10 ms and
that the first one starts its first sleep 70 us before the other one.
That is, the first one always calles usleep_range(5000, 5000 + delta)
70 us before the other one.
If delta is 50 us, their timers will never coalesce, but if delta is
100 us, they'll always do.
Generally speaking, longer delta values make coalescing more likely.
> That pattern doesn't necessarily depend on sleep duration,
> so it is a hard sell to tie them together.
But it can be argued that delta can be somewhat larger (increasing the
likelihood of timer coalescing) for longer sleeps because they
generally don't need high precision.
Powered by blists - more mailing lists