Re: [RFC PATCH] sched, timer: Use atomics for thread_group_cputimer stats

Peter Zijlstra
2015-01-23T09:33:45Z

> + .running = ATOMIC_INIT(0), \
> + atomic_t running;
> + atomic_set(&sig->cputimer.running, 1);
> @@ -174,7 +174,7 @@ static inline bool cputimer_running(struct task_struct *tsk)
> + if (!atomic_read(&cputimer->running))
> + if (!atomic_read(&cputimer->running)) {
> + atomic_set(&cputimer->running, 1);
> + if (atomic_read(&tsk->signal->cputimer.running))
> + atomic_set(&cputimer->running, 0);
> + if (atomic_read(&sig->cputimer.running)) {
> + if (atomic_read(&tsk->signal->cputimer.running))

That doesn't really need an atomic_t.