[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160406065436.GB3078@gmail.com>
Date: Wed, 6 Apr 2016 08:54:36 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: tglx@...utronix.de, efault@....de, htejun@...il.com,
linux-kernel@...r.kernel.org, tj@...nel.org,
torvalds@...ux-foundation.org, zhaolei@...fujitsu.com,
peterz@...radead.org, yangds.fnst@...fujitsu.com, hpa@...or.com
Subject: Re: [tip:sched/core] sched/cpuacct: Split usage accounting into
user_usage and sys_usage
* Srikar Dronamraju <srikar@...ux.vnet.ibm.com> wrote:
> * tip-bot for Dongsheng Yang <tipbot@...or.com> [2016-03-31 02:27:39]:
>
> > Commit-ID: d740037fac7052e49450f6fa1454f1144a103b55
> > Gitweb: http://git.kernel.org/tip/d740037fac7052e49450f6fa1454f1144a103b55
> > Author: Dongsheng Yang <yangds.fnst@...fujitsu.com>
> > AuthorDate: Tue, 22 Mar 2016 16:37:08 +0800
> > Committer: Ingo Molnar <mingo@...nel.org>
> > CommitDate: Thu, 31 Mar 2016 10:48:54 +0200
> >
> > sched/cpuacct: Split usage accounting into user_usage and sys_usage
> >
> > Sometimes, cpuacct.usage is not detailed enough to see how much CPU
> > usage a group had. We want to know how much time it used in user mode
> > and how much in kernel mode.
> >
>
> Unfortunately this commit causes boot to fail on my power 7 box.
>
> > @@ -238,10 +316,18 @@ static struct cftype files[] = {
> > void cpuacct_charge(struct task_struct *tsk, u64 cputime)
> > {
> > struct cpuacct *ca;
> > + int index;
> > +
> > + if (user_mode(task_pt_regs(tsk)))
> > + index = CPUACCT_USAGE_USER;
> > + else
> > + index = CPUACCT_USAGE_SYSTEM;
> >
> > rcu_read_lock();
> > +
> > for (ca = task_ca(tsk); ca; ca = parent_ca(ca))
> > - *this_cpu_ptr(ca->cpuusage) += cputime;
> > + this_cpu_ptr(ca->cpuusage)->usages[index] += cputime;
>
> The above line seems to be the cause of oops. Attached the complete console log below.
Weird - not much changed wrt. the cpuusage logic, we only increased its size.
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;
}
then do you get the warning and the bootup succeeds?
Thanks,
Ingo
Powered by blists - more mailing lists