mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Charles (Chas) Williams" <ciwillia@brocade.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, <rt@linutronix.de>
Subject: Re: [PREEMPT-RT] Oops in rapl_cpu_prepare()
Date: Fri, 21 Oct 2016 17:03:56 -0400	[thread overview]
Message-ID: <4e56a576-1a9f-e195-5ed9-2bc7169c4d94@brocade.com> (raw)
In-Reply-To: <20161021105630.y2iym7smtdpyo54z@linutronix.de>

On 10/21/2016 06:56 AM, Sebastian Andrzej Siewior wrote:
> 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?

I can't get dedicated access to the specific bare metal since it is
running as a dedicated hypervisor.  I haven't seen this issue anywhere
else though with the 4.8 kernel.

>> [    2.270203] BUG: unable to handle kernel NULL pointer dereference at 0000000000000408
>> [    2.270325] IP: [<ffffffff81012bb9>] rapl_cpu_online+0x59/0x70
>
> can you check if pmu is NULL?

It's not.  The dereference at 0x408 and pmu->cpu being fairly early in
the struct seems to indicate that pmu wasn't pointing to 0 at the time
(but fairly close).  I should have noticed that earlier.

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

Yes, I see that now.  Thanks for the pointer!

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

You'll like this, I just did a little printk debugging because it was
easier than trying to get a debugger running:

	[    3.107126] init_rapl_pmus: maxpkg 4
	[    3.107263] rapl_cpu_prepare: pmu ffff880234faa540  cpu 0  pkgid 0
	[    3.107400] rapl_cpu_prepare: pmu ffff880234faa600  cpu 1  pkgid 2
	[    3.107537] rapl_cpu_prepare: pmu ffff880234faa6c0  cpu 2  pkgid 65535
	[    3.107662] rapl_cpu_online: pmu ffff880234faa540 cpu 0 pkgid 0
	[    3.107907] rapl_cpu_online: pmu ffff880234faa600 cpu 1 pkgid 2
	[    3.108133] rapl_cpu_online: pmu ffff880234faa6c0 cpu 2 pkgid 65535
	[    3.108333] rapl_cpu_online: pmu ffff880234faa6c0 cpu 3 pkgid 65535

where pkgid is topology_logical_package_id(cpu).

I can't understand why I don't see a cpu 3 during cpu prepare, when I
see one later.  The 65535 is a -1 from topology_phys_to_logical_pkg()
getting assigned to the logical_proc_id apparently.

So this is pretty puzzling.  Since this is a guest running under VMWare, I
don't know that there is any particular CPU pinning or emulation of RAPL.

It looks there was a proposal to not run in guests:

https://lkml.org/lkml/2015/12/3/559

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 20:27 Charles (Chas) Williams
2016-10-21 10:56 ` [PREEMPT-RT] " Sebastian Andrzej Siewior
2016-10-21 21:03   ` Charles (Chas) Williams [this message]
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=4e56a576-1a9f-e195-5ed9-2bc7169c4d94@brocade.com \
    --to=ciwillia@brocade.com \
    --cc=bigeasy@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®