All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Charles (Chas) Williams" <ciwillia@brocade.com>
Cc: linux-kernel@vger.kernel.org, rt@linutronix.de
Subject: Re: [PREEMPT-RT] Oops in rapl_cpu_prepare()
Date: Fri, 21 Oct 2016 12:56:30 +0200	[thread overview]
Message-ID: <20161021105630.y2iym7smtdpyo54z@linutronix.de> (raw)
In-Reply-To: <d40f8e3c-b332-c331-38b9-11eb4f4aaaa7@brocade.com>

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

  reply	other threads:[~2016-10-21 10:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 20:27 Oops in rapl_cpu_prepare() Charles (Chas) Williams
2016-10-21 10:56 ` Sebastian Andrzej Siewior [this message]
2016-10-21 21:03   ` [PREEMPT-RT] " Charles (Chas) Williams
2016-10-25 12:22     ` Sebastian Andrzej Siewior
2016-10-25 12:42       ` Sebastian Andrzej Siewior
2016-10-27 19:00       ` Charles (Chas) Williams
2016-10-28  8:03         ` Sebastian Andrzej Siewior
2016-11-01 10:15           ` M. Vefa Bicakci
2016-11-02 17:23             ` Sebastian Andrzej Siewior
2016-11-03 18:21               ` M. Vefa Bicakci
2016-11-02  9:16           ` Charles (Chas) Williams
2016-11-02  9:58             ` Sebastian Andrzej Siewior

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=20161021105630.y2iym7smtdpyo54z@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=ciwillia@brocade.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rt@linutronix.de \
    /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.