Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1505775

Re: [PREEMPT-RT] Oops in rapl_cpu_prepare()

From Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PREEMPT-RT] Oops in rapl_cpu_prepare()
Date 2016-10-21 13:00 +0200
Message-ID <suFIm-4q7-7@gated-at.bofh.it> (permalink)
References <sus8p-3Z6-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016-10-20 16:27:55 [-0400], Charles (Chas) Williams wrote:
> Recent 4.8 kernels have been oopsing when running under VMWare:

can you reproduce this on bare metal?

> [    2.270203] BUG: unable to handle kernel NULL pointer dereference at 0000000000000408
> [    2.270325] IP: [<ffffffff81012bb9>] rapl_cpu_online+0x59/0x70
…
> 
> gdb tells me:
> 
> (gdb) info line *(rapl_cpu_online+0x59)
> Line 595 of "arch/x86/events/intel/rapl.c" starts at address 0xffffffff81012bb9 <rapl_cpu_online+89>
>    and ends at 0xffffffff81012bbe <rapl_cpu_online+94>.
> 
> Which is:
> 
> 
>         target = cpumask_any_and(&rapl_cpu_mask, topology_core_cpumask(cpu));
>         if (target < nr_cpu_ids)
>                 return 0;
> 
>         cpumask_set_cpu(cpu, &rapl_cpu_mask);
>         pmu->cpu = cpu;		<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

can you check if pmu is NULL?

>         return 0;
…

> Is there a particular order guaranteed by the callbacks?  Will
> rapl_cpu_prepare() always happen before online/offline?  Additionally,

yes, see include/linux/cpuhotplug.h. On CPU-up the array ids are invoked
from CPUHP_OFFLINE till CPUHP_ONLINE.

> rapl_cpu_prepare() can fail to allocate pmu,

error codes callbacks are handled.

…
> But rapl_cpu_online() would have no idea about this.  What should be
> done in this case?

If a callback (such as CPUHP_PERF_X86_RAPL_PREP) fail then we rollback
to the starting point (in case of CPU up it would be CPUHP_OFFLINE.

Sebastian

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Oops in rapl_cpu_prepare() "Charles (Chas) Williams" <ciwillia@brocade.com> - 2016-10-20 22:30 +0200
  Re: [PREEMPT-RT] Oops in rapl_cpu_prepare() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-21 13:00 +0200
    Re: [PREEMPT-RT] Oops in rapl_cpu_prepare() "Charles (Chas) Williams" <ciwillia@brocade.com> - 2016-10-21 23:10 +0200
      Re: [PREEMPT-RT] Oops in rapl_cpu_prepare() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-25 14:30 +0200
        Re: [PREEMPT-RT] Oops in rapl_cpu_prepare() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-25 14:50 +0200

csiph-web