All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: "'Ingo Molnar'" <mingo@kernel.org>,
	"'Srikar Dronamraju'" <srikar@linux.vnet.ibm.com>
Cc: <tglx@linutronix.de>, <efault@gmx.de>, <htejun@gmail.com>,
	<linux-kernel@vger.kernel.org>, <tj@kernel.org>,
	<torvalds@linux-foundation.org>, <peterz@infradead.org>,
	<yangds.fnst@cn.fujitsu.com>, <hpa@zytor.com>
Subject: RE: [tip:sched/core] sched/cpuacct: Split usage accounting into user_usage and sys_usage
Date: Wed, 6 Apr 2016 15:47:18 +0800	[thread overview]
Message-ID: <007901d18fd8$8c1e7810$a45b6830$@cn.fujitsu.com> (raw)
In-Reply-To: <20160406065436.GB3078@gmail.com>

Hi, Ingo and Srikar,

> -----Original Message-----
> From: Ingo Molnar [mailto:mingo.kernel.org@gmail.com] On Behalf Of Ingo
> Molnar
> Sent: Wednesday, April 06, 2016 2:55 PM
> To: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Cc: tglx@linutronix.de; efault@gmx.de; htejun@gmail.com;
> linux-kernel@vger.kernel.org; tj@kernel.org; torvalds@linux-foundation.org;
> zhaolei@cn.fujitsu.com; peterz@infradead.org; yangds.fnst@cn.fujitsu.com;
> hpa@zytor.com
> Subject: Re: [tip:sched/core] sched/cpuacct: Split usage accounting into
> user_usage and sys_usage
> 
> 
> * Srikar Dronamraju <srikar@linux.vnet.ibm.com> wrote:
> 
> > * tip-bot for Dongsheng Yang <tipbot@zytor.com> [2016-03-31 02:27:39]:
> >
> > > Commit-ID:  d740037fac7052e49450f6fa1454f1144a103b55
> > > Gitweb:
> http://git.kernel.org/tip/d740037fac7052e49450f6fa1454f1144a103b55
> > > Author:     Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> > > AuthorDate: Tue, 22 Mar 2016 16:37:08 +0800
> > > Committer:  Ingo Molnar <mingo@kernel.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.
> 
Thanks for reporting this bug.
I'll take over this patch.

> Weird - not much changed wrt. the cpuusage logic, we only increased its size.
> 
Thanks for concern.
I trying to review this patch, but had not found something strange, except:

> 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?

But preempt problem should not cause problem in every boot,
And Srikar's bisect means it failed in every boot.

> 	}
> 
> then do you get the warning and the bootup succeeds?
> 
I also building a power7 vm for test, still in building...

Thanks
Zhaolei

  reply	other threads:[~2016-04-06  7:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22  8:37 [PATCH v4 0/4] cpuacct: split usage into user_usage and sys_usage Zhao Lei
2016-03-22  8:37 ` [PATCH v4 1/4] cpuacct: rename parameter in cpuusage_write for readability Zhao Lei
2016-03-22  8:37 ` [PATCH v4 2/4] cpuacct: small restruct for cpuacct Zhao Lei
2016-03-22  8:37 ` [PATCH v4 3/4] cpuacct: Show possible_cpu in cpuacct Zhao Lei
2016-03-31  9:27   ` [tip:sched/core] sched/cpuacct: Show all possible CPUs in cpuacct output tip-bot for Zhao Lei
2016-03-22  8:37 ` [PATCH v4 4/4] cpuacct: split usage into user_usage and sys_usage Zhao Lei
2016-03-31  9:27   ` [tip:sched/core] sched/cpuacct: Split usage accounting " tip-bot for Dongsheng Yang
2016-04-04 14:03     ` Srikar Dronamraju
2016-04-06  6:54       ` Ingo Molnar
2016-04-06  7:47         ` Zhao Lei [this message]
2016-04-06  7:50           ` Peter Zijlstra
2016-04-06 10:32         ` Anton Blanchard
2016-04-06 11:08           ` Peter Zijlstra
2016-04-06 11:43             ` Zhao Lei
2016-04-06 11:59             ` [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs() Anton Blanchard
2016-04-06 13:26               ` Srikar Dronamraju
2016-04-06 17:05                 ` Zhao Lei
2016-04-06 17:05                   ` Zhao Lei
2016-04-13  7:43                 ` Ingo Molnar
2016-04-13 11:01                   ` Michael Ellerman
2016-04-13 11:01                     ` Michael Ellerman
2016-04-13 11:21                     ` Ingo Molnar
2016-04-11  6:16               ` Ping? " Michael Ellerman
2016-04-11  6:16                 ` Michael Ellerman
2016-04-13 11:49               ` [tip:sched/core] " tip-bot for Anton Blanchard
2016-03-22  9:44 ` [PATCH v4 0/4] cpuacct: split usage into user_usage and sys_usage Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='007901d18fd8$8c1e7810$a45b6830$@cn.fujitsu.com' \
    --to=zhaolei@cn.fujitsu.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yangds.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.