From: Venkatesh Pallipadi <venki@google.com>
To: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: linux-kernel@vger.kernel.org, Venkatesh Pallipadi <venki@google.com>
Subject: [PATCH] x86: Wrong /proc/cpuinfo core id on AMD fam_f model_9
Date: Thu, 12 Aug 2010 14:28:49 -0700 [thread overview]
Message-ID: <1281648529-29678-1-git-send-email-venki@google.com> (raw)
Commit 4a376ec3a2599c02207cd4cbd5dbf73783548463 changes cpuinfo cpu_core_id
from an unique id in a physical package to core id within a node. And it
does not change phys_proc_id or booted_cores to reflect this new topology.
This breaks the user view of topology in /proc/cpuinfo.
With commit 4a376ec /proc/cpuinfo output (for one package) looks something like
processor: 0..11
physical id: 0..0
core id: 0..5 0..5
siblings: 12
cpu cores: 12
That is, there are processors with same "physical id" and same "core id" (which
are not SMT siblings). As I understand, if /proc/cpuinfo says there are 12
"cpu cores" per package, there should be 12 unique core ids in that package.
And same "physical id" and "core id" is supposed to indicate SMT siblings.
The change below reverts the cpu_core_id part of that commit and
/proc/cpuinfo has
processor: 0..11
physical id: 0..0
core id: 0..11
siblings: 12
cpu cores: 12
Also, if the intention of the original change was to export two node info,
then changing just the core id is not enough. User has no way to determine
which of these 6 cores out of 12 belong to same node by looking at
/proc/cpuinfo output. Both "physical id" and "cpu cores" has to change
to reflect that or one more node id needs to be added (I didn't say that :))
Signed-off-by: Venkatesh Pallipadi <venki@google.com>
---
arch/x86/kernel/cpu/amd.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index e485825..80d3d80 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -281,9 +281,6 @@ static void __cpuinit amd_fixup_dcm(struct cpuinfo_x86 *c)
/* store NodeID, use llc_shared_map to store sibling info */
per_cpu(cpu_llc_id, cpu) = value & 7;
-
- /* fixup core id to be in range from 0 to (cores_per_node - 1) */
- c->cpu_core_id = c->cpu_core_id % cores_per_node;
}
#endif
--
1.7.1
next reply other threads:[~2010-08-12 21:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 21:28 Venkatesh Pallipadi [this message]
2010-08-13 7:04 ` Andreas Herrmann
2010-08-13 17:52 ` Venkatesh Pallipadi
2010-08-13 19:05 ` Venkatesh Pallipadi
2010-08-18 19:17 ` Andreas Herrmann
2010-08-25 21:52 ` Venkatesh Pallipadi
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=1281648529-29678-1-git-send-email-venki@google.com \
--to=venki@google.com \
--cc=andreas.herrmann3@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@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
Powered by JetHome