From: Peter Zijlstra <peterz@infradead.org>
To: kan.liang@linux.intel.com
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
steve.wahl@hpe.com, john.p.donnelly@oracle.com,
brian.maly@oracle.com, jack.vogel@oracle.com, ak@linux.intel.com
Subject: Re: [PATCH] perf/x86/intel/uncore: Fix a kernel WARNING triggered by maxcpus=1
Date: Thu, 27 May 2021 13:14:01 +0200 [thread overview]
Message-ID: <YK9++al/J4Jm9W1J@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1622037527-156028-1-git-send-email-kan.liang@linux.intel.com>
On Wed, May 26, 2021 at 06:58:47AM -0700, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> A kernel WARNING may be triggered when setting maxcpus=1.
>
> The uncore counters are Die-scope. When probing a PCI device, only the
> BUS information can be retrieved. The uncore driver has to maintain a
> mapping table used to calculate the logical Die ID from a given BUS#.
>
> Before the patch ba9506be4e40, the mapping table stores the mapping
> information from the BUS# -> a Physical Socket ID. To calculate the
> logical die ID, perf does,
> - In snbep_pci2phy_map_init(), retrieve the BUS# -> a Physical Socket ID
> from the UBOX PCI configure space.
> - Calculate the mapping information (a BUS# -> a Physical Socket ID) for
> the other PCI BUS.
> - In the uncore_pci_probe(), get the physical Socket ID from a given BUS
> and the mapping table.
> - Calculate the logical Die ID
>
> Since only the logical Die ID is required, with the patch ba9506be4e40,
> the mapping table stores the mapping information from the BUS# -> a
> logical Die ID. Now perf does,
> - In snbep_pci2phy_map_init(), retrieve the BUS# -> a Physical Socket ID
> from the UBOX PCI configure space.
> - Calculate the logical Die ID
> - Calculate the mapping information (a BUS# -> a logical Die ID) for the
> other PCI BUS.
> - In the uncore_pci_probe(), get the logical die ID from a given BUS and
> the mapping table.
>
> When calculating the logical Die ID, -1 may be returned, especially when
> maxcpus=1. Here, -1 means the logical Die ID is not found. But when
> calculating the mapping information for the other PCI BUS, -1 indicates
> that it's the other PCI BUS that requires the calculation of the
> mapping. The driver will mistakenly do the calculation.
>
> Uses the -ENODEV to indicate the case which the logical Die ID is not
> found. The driver will not mess up the mapping table anymore.
>
> Fixes: ba9506be4e40 ("perf/x86/intel/uncore: Store the logical die id
> instead of the physical die id.")
(please don't wrap like that)
> Reported-by: John Donnelly <john.p.donnelly@oracle.com>
> Tested-by: John Donnelly <john.p.donnelly@oracle.com>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Thanks!
next prev parent reply other threads:[~2021-05-27 11:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 13:58 [PATCH] perf/x86/intel/uncore: Fix a kernel WARNING triggered by maxcpus=1 kan.liang
2021-05-27 11:14 ` Peter Zijlstra [this message]
2021-05-27 20:13 ` John Donnelly
2021-05-31 10:40 ` [tip: perf/urgent] " tip-bot2 for Kan Liang
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=YK9++al/J4Jm9W1J@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ak@linux.intel.com \
--cc=brian.maly@oracle.com \
--cc=jack.vogel@oracle.com \
--cc=john.p.donnelly@oracle.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=steve.wahl@hpe.com \
/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