Re: [PATCH 1/4] cpufreq: stats: Defer stats update to cpufreq_stats_record_transition()

peterz
2020-09-11T10:11:45Z

On Wed, Sep 02, 2020 at 12:54:41PM +0530, Viresh Kumar wrote:
> + atomic_t reset_pending;

> + atomic_set(&stats->reset_pending, 0);
> + if (atomic_read(&stats->reset_pending))
> + bool pending = atomic_read(&stats->reset_pending);
> + atomic_set(&stats->reset_pending, 1);
> + bool pending = atomic_read(&stats->reset_pending);
> + if (atomic_read(&stats->reset_pending))

What do you think atomic_t is doing for you?