mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] display phys_proc_id only when it is initialized
Date: Fri, 1 Oct 2004 16:29:00 -0700	[thread overview]
Message-ID: <20041001162900.B10406@unix-os.sc.intel.com> (raw)


phys_proc_id gets initialized only when (smp_num_siblings > 1).
But gets printed even when (smp_num_siblings == 1). As a result we print 
incorrect physical processor id in /proc/cpuinfo, when HT is disabled.

This patch fixes it.

Signed-off-by:: "Venkatesh Pallipadi" <venkatesh.pallipadi@intel.com>

--- linux-2.6.9-rc2/arch/i386/kernel/cpu/proc.c.org	2004-08-29 22:59:21.334053528 -0700
+++ linux-2.6.9-rc2/arch/i386/kernel/cpu/proc.c	2004-08-29 22:57:55.882044208 -0700
@@ -88,7 +88,7 @@ static int show_cpuinfo(struct seq_file 
 	if (c->x86_cache_size >= 0)
 		seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 #ifdef CONFIG_X86_HT
-	if (cpu_has_ht) {
+	if (smp_num_siblings > 1) {
 		extern int phys_proc_id[NR_CPUS];
 		seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]);
 		seq_printf(m, "siblings\t: %d\n", smp_num_siblings);
--- linux-2.6.9-rc2/arch/x86_64/kernel/setup.c.org	2004-08-29 01:08:29.690920728 -0700
+++ linux-2.6.9-rc2/arch/x86_64/kernel/setup.c	2004-08-29 23:00:26.301177024 -0700
@@ -1132,7 +1132,7 @@ static int show_cpuinfo(struct seq_file 
 		seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 	
 #ifdef CONFIG_X86_HT
-	if (cpu_has_ht) {
+	if (smp_num_siblings > 1) {
 		seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]);
 		seq_printf(m, "siblings\t: %d\n", smp_num_siblings);
 	}

                 reply	other threads:[~2004-10-01 23:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041001162900.B10406@unix-os.sc.intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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