On Wed, Nov 20, 2024 at 8:18 PM Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> wrote: > > On 11/20/2024 10:49 AM, Rafael J. Wysocki wrote: > >>> I thought about something on the order of 199 us, but now I'm thinking > >>> that 50 us would work too. Less than this - I'm not sure. > >> > >> 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? > > I don't see why you'd make it dependent on the sleep duration > sure in theory the longer the sleep -- you could pick a fixed percentage > > but you're trying to amortize a theoretical timer register write, and a > cpu wakeup. the timer write is fixed cost and not THAT expensive after > some amount of this . the C state wake up --- sure that is more variable > but that is super important for high occurance things (thousands to millions > of times per hour). > If your ACPI sleeps are high occurance on a system I suspect you have way > bigger problems than an occasional extra wakeup I generally think that if you are sleeping relatively long, you may as well sacrifice some precision for avoiding system stress so to speak, so I've been considering something like flat 50 us for sleeps between 1 and 5 ms and then 1% of the sleep duration for longer sleeps.