From: Alex Chiang <achiang@hp.com>
To: Len Brown <lenb@kernel.org>, akpm@linux-foundation.org
Cc: linux-acpi <linux-acpi@vger.kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] [RFC] Expose _SUN in /proc/acpi/processor/<...>/info
Date: Tue, 30 Oct 2007 17:50:57 -0600 [thread overview]
Message-ID: <20071030235057.GD3127@ldl.fc.hp.com> (raw)
In-Reply-To: <20071019193844.GL8122@ldl.fc.hp.com>
Hello,
I'm looking for comments on the following patch that exposes _SUN
on processor objects in /proc/acpi/processor/<...>/info.
This didn't get many comments on the linux-acpi list, so I'm
sending to a wider distribution.
I notice that acpiphp exposes _SUN for (hotpluggable) PCI slots
in /sys/bus/pci/slots/N/, where N is the value of _SUN. I'm not
so sure we want to go *exactly* in the same direction for CPUs,
because:
- x86 systems might not implement _SUN for processors
- ia64 systems that implement ACPI 2.x do not have unique
values for _SUN across the entire system
Nonetheless, even non-unique values of _SUN are still helpful for
userspace to figure out which physical socket a CPU might be in,
especially when combined with information from /proc/cpuinfo.
Thoughts?
Thanks.
/ac
From: Alex Chiang <achiang@hp.com>
On platforms that provide _SUN for the processor object, higher
level software can consume the data to learn physical topology
information, so let's expose it.
Platforms that do not implement _SUN will see <not supported>.
Signed-off-by: Alex Chiang <achiang@hp.com>
---
drivers/acpi/processor_core.c | 11 +++++++++++
include/acpi/processor.h | 1 +
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 235a51e..86cb41a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -302,6 +302,11 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
pr->flags.throttling ? "yes" : "no",
pr->flags.limit ? "yes" : "no");
+ if (pr->sun == -1)
+ seq_printf(seq, "slot user number: <not supported>\n");
+ else
+ seq_printf(seq, "slot user number: %d\n", (int)pr->sun);
+
end:
return 0;
}
@@ -590,6 +595,12 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
pr->acpi_id));
+ status = acpi_evaluate_object(pr->handle, "_SUN", NULL, &buffer);
+ if (ACPI_FAILURE(status))
+ object.integer.value = -1;
+
+ pr->sun = object.integer.value;
+
if (!object.processor.pblk_address)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
else if (object.processor.pblk_length != 6)
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 26d79f6..81792c6 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -210,6 +210,7 @@ struct acpi_processor {
u32 acpi_id;
u32 id;
u32 pblk;
+ acpi_native_int sun;
int performance_platform_limit;
int throttling_platform_limit;
/* 0 - states 0..n-th state available */
--
1.5.3.1.1.g1e61
next prev parent reply other threads:[~2007-10-30 23:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-19 19:38 [PATCH RFC] Expose _SUN in /proc/acpi/processor/<...>/info Alex Chiang
2007-10-30 23:50 ` Alex Chiang [this message]
2007-11-19 17:54 ` [PATCH] [RFC] " Len Brown
2007-12-13 19:08 ` Alex Chiang
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=20071030235057.GD3127@ldl.fc.hp.com \
--to=achiang@hp.com \
--cc=akpm@linux-foundation.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.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 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.