Re: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-13 Thread Ingo Molnar
* Michael Ellerman wrote: > On Wed, 2016-04-13 at 09:43 +0200, Ingo Molnar wrote: > > * Srikar Dronamraju wrote: > > > > > * Anton Blanchard [2016-04-06 21:59:50]: > > > > > > > Looks good, and the patch below does fix the

Re: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-13 Thread Michael Ellerman
On Wed, 2016-04-13 at 09:43 +0200, Ingo Molnar wrote: > * Srikar Dronamraju wrote: > > > * Anton Blanchard [2016-04-06 21:59:50]: > > > > > Looks good, and the patch below does fix the oops for me. > > > > > > Anton > > > -- > > > > > >

[PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-13 Thread Anton Blanchard via Linuxppc-dev
task_pt_regs() can return NULL for kernel threads, so add a check. This fixes an oops at boot on ppc64. Fixes: d740037fac70 ("sched/cpuacct: Split usage accounting into user_usage and sys_usage") Signed-off-by: Anton Blanchard Reported-and-Tested-by: Srikar Dronamraju

Re: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-13 Thread Ingo Molnar
* Srikar Dronamraju wrote: > * Anton Blanchard [2016-04-06 21:59:50]: > > > Looks good, and the patch below does fix the oops for me. > > > > Anton > > -- > > > > task_pt_regs() can return NULL for kernel threads, so add a check. > > This fixes an

Ping? Re: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-11 Thread Michael Ellerman
Hi Peter/Ingo, On Wed, 2016-04-06 at 21:59 +1000, Anton Blanchard wrote: > Hi Peter, > > > Ah, so sometihng like: > > > > struct pt_regs *regs = task_pt_regs(); > > int index = CPUACCT_USAGE_SYSTEM; > > > > if (regs && user_mode(regs)) > > index = CPUACCT_USAGE_USER; >

RE: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-06 Thread Zhao Lei
t;; > linuxppc-dev@lists.ozlabs.org > Subject: Re: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs() > > * Anton Blanchard <an...@samba.org> [2016-04-06 21:59:50]: > > > Looks good, and the patch below does fix the oops for me. > > > > Anton > >

Re: [PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-06 Thread Srikar Dronamraju
* Anton Blanchard [2016-04-06 21:59:50]: > Looks good, and the patch below does fix the oops for me. > > Anton > -- > > task_pt_regs() can return NULL for kernel threads, so add a check. > This fixes an oops at boot on ppc64. > > Signed-off-by: Anton Blanchard

[PATCH] sched/cpuacct: Check for NULL when using task_pt_regs()

2016-04-06 Thread Anton Blanchard via Linuxppc-dev
Hi Peter, > Ah, so sometihng like: > > struct pt_regs *regs = task_pt_regs(); > int index = CPUACCT_USAGE_SYSTEM; > > if (regs && user_mode(regs)) > index = CPUACCT_USAGE_USER; > > should work, right? Looks good, and the patch below does fix the oops for me.