On Wed, Apr 06, 2016 at 03:47:18PM +0800, Zhao Lei wrote:
> > If you change the above loop to something like:
> > 
> >     for (ca = task_ca(tsk); ca; ca = parent_ca(ca)) {
> >             if (WARN_ON_ONCE(!ca->cpuusage))
> >                     continue;
> >             this_cpu_ptr(ca->cpuusage)->usages[index] += cputime;
> 
> Or s/ this_cpu_ptr/get_cpu_var to avoid preempt?

This is all called with rq->lock held, preemption is firmly disabled.

Reply via email to