Re: [PATCH V5] powercap/drivers/idle_injection: Add an idle injection framework
From: Peter Zijlstra
Date: Wed Jun 06 2018 - 08:24:08 EST
On Tue, Jun 05, 2018 at 11:16:40AM +0200, Daniel Lezcano wrote:
> + atomic_t idle_duration_ms;
> + atomic_t run_duration_ms;
> + idle_duration_ms = atomic_read(&ii_dev->idle_duration_ms);
> + run_duration_ms = atomic_read(&ii_dev->run_duration_ms);
> + atomic_set(&ii_dev->run_duration_ms, run_duration_ms);
> + atomic_set(&ii_dev->idle_duration_ms, idle_duration_ms);
> + *run_duration_ms = atomic_read(&ii_dev->run_duration_ms);
> + *idle_duration_ms = atomic_read(&ii_dev->idle_duration_ms);
> + if (!atomic_read(&ii_dev->idle_duration_ms))
> + if (!atomic_read(&ii_dev->run_duration_ms))
What is the point of atomic_t here ?!