lkml.org 
[lkml]   [2022]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/3] sched/core: Force idle accounting per cgroup
Hello,

On Tue, Jan 11, 2022 at 05:56:01PM +0800, Cruz Zhao wrote:
> +#ifdef CONFIG_SCHED_CORE
> +void cpuacct_account_forceidle(int cpu, struct task_struct *tsk, u64 cputime)
> +{
> + struct cpuacct *ca;
> + u64 *fi;
> +
> + rcu_read_lock();
> + /*
> + * We have hold rq->core->__lock here, which protects ca->forceidle
> + * percpu.
> + */
> + for (ca = task_ca(tsk); ca; ca = parent_ca(ca)) {
> + fi = per_cpu_ptr(ca->forceidle, cpu);
> + *fi += cputime;
> + }

Please don't do this. Use rstat and integrate it with other stats.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2022-01-12 21:42    [W:0.134 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site