Re: [PATCH 2/6] posix-cpu-timers: Don't start process wide cputime counter if timer is disabled

From: Peter Zijlstra
Date: Wed Jun 16 2021 - 07:51:09 EST


On Wed, Jun 16, 2021 at 01:26:30PM +0200, Peter Zijlstra wrote:
> Right, so by the time patch #5 comes around, you seem to be at the point
> where you can do:
>
> * fetch cputime and start threadgroup counter
>
> * possibly arm timer

- possibly

>
> * if expired:
> - fire now
> - if armed, disarm (which leads to stop)
>
> Which is the other 'obvious' solution to not starting it.

So we unconditionally start and arm, and then have the early expire do
the same things as regular expire.