Re: [patch V2 08/38] posix-cpu-timers: Consolidate thread group sample code

From: Frederic Weisbecker
Date: Thu Aug 22 2019 - 09:49:28 EST


On Wed, Aug 21, 2019 at 09:08:55PM +0200, Thomas Gleixner wrote:
> cpu_clock_sample_group() and cpu_timer_sample_group() are almost the
> same. Before the rename one called thread_group_cputimer() and the other
> thread_group_cputime(). Really intuitive function names.
>
> Consolidate the functions and also avoid the thread traversal when
> the thread group's accounting is already active.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
[snip]
> @@ -755,7 +736,7 @@ static void posix_cpu_timer_get(struct k
> timer->it.cpu.expires = 0;
> return;
> } else {
> - cpu_timer_sample_group(timer->it_clock, p, &now);
> + cpu_clock_sample_group(timer->it_clock, p, &now, false);

We might want to warn here if !cputimer->running.

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>