Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329AbcDFKdV (ORCPT ); Wed, 6 Apr 2016 06:33:21 -0400 Received: from hr2.samba.org ([144.76.82.148]:51128 "EHLO hr2.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbcDFKdU (ORCPT ); Wed, 6 Apr 2016 06:33:20 -0400 Date: Wed, 6 Apr 2016 20:32:19 +1000 From: Anton Blanchard To: Ingo Molnar Cc: Srikar Dronamraju , 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, Stephen Rothwell , Michael Ellerman Subject: Re: [tip:sched/core] sched/cpuacct: Split usage accounting into user_usage and sys_usage Message-ID: <20160406203219.788ae7cf@kryten> In-Reply-To: <20160406065436.GB3078@gmail.com> References: <20160404140312.GA28495@linux.vnet.ibm.com> <20160406065436.GB3078@gmail.com> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 353 Lines: 16 Hi, > > > 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; This is oopsing because PowerPC task_pt_regs() returns NULL for kernel threads. Anton