[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o8fhl8om.fsf@oracle.com>
Date: Wed, 17 Mar 2021 18:25:13 -0400
From: Daniel Jordan <daniel.m.jordan@...cle.com>
To: Andrey Ryabinin <arbn@...dex-team.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>
Cc: Boris Burkov <boris@....io>,
Bharata B Rao <bharata@...ux.vnet.ibm.com>,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrey Ryabinin <arbn@...dex-team.com>
Subject: Re: [PATCH 4/4] sched/cpuacct: Make user/system times in
cpuacct.stat more precise
Andrey Ryabinin <arbn@...dex-team.com> writes:
> static int cpuacct_stats_show(struct seq_file *sf, void *v)
> {
...
> for_each_possible_cpu(cpu) {
> u64 *cpustat = per_cpu_ptr(ca->cpustat, cpu)->cpustat;
>
> - val[CPUACCT_STAT_USER] += cpustat[CPUTIME_USER];
> - val[CPUACCT_STAT_USER] += cpustat[CPUTIME_NICE];
> - val[CPUACCT_STAT_SYSTEM] += cpustat[CPUTIME_SYSTEM];
> - val[CPUACCT_STAT_SYSTEM] += cpustat[CPUTIME_IRQ];
> - val[CPUACCT_STAT_SYSTEM] += cpustat[CPUTIME_SOFTIRQ];
> + cputime.utime += cpustat[CPUTIME_USER];
> + cputime.utime += cpustat[CPUTIME_NICE];
> + cputime.stime += cpustat[CPUTIME_SYSTEM];
> + cputime.stime += cpustat[CPUTIME_IRQ];
> + cputime.stime += cpustat[CPUTIME_SOFTIRQ];
> +
> + cputime.sum_exec_runtime += this_cpu_read(*ca->cpuusage);
> }
cputime.sum_exec_runtime += *per_cpu_ptr(ca->cpuusage, cpu);
Or the stats can all be 0...
Powered by blists - more mailing lists