[PATCH] [RFC] Expose _SUN in /proc/acpi/processor/<...>/info

Previous thread: [2.6 patch] make ata_scsi_lpm_get() static by Adrian Bunk on Tuesday, October 30, 2007 - 4:50 pm. (2 messages)

Next thread: Re: pdflush stuck in D state with v2.6.24-rc1-192-gef49c32 by Florin Iucha on Tuesday, October 30, 2007 - 5:02 pm. (3 messages)
From: Alex Chiang
Date: Tuesday, October 30, 2007 - 4:50 pm

Hello,

I'm looking for comments on the following patch that exposes _SUN
on processor objects in /proc/acpi/processor/&lt;...&gt;/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 &lt;achiang@hp.com&gt;

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 &lt;not supported&gt;.

Signed-off-by: Alex Chiang &lt;achiang@hp.com&gt;
---
 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-&gt;flags.throttling ? &quot;yes&quot; : &quot;no&quot;,
 		   pr-&gt;flags.limit ? &quot;yes&quot; : &quot;no&quot;);
 
+	if (pr-&gt;sun == -1)
+		seq_printf(seq, &quot;slot user number:        &lt;not supported&gt;\n&quot;);
+	else
+		seq_printf(seq, &quot;slot user number:        %d\n&quot;, (int)pr-&gt;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, &quot;Processor [%d:%d]\n&quot;, pr-&gt;id,
 			  ...
From: Len Brown
Date: Monday, November 19, 2007 - 10:54 am

We've not allowed new features in /proc/acpi
since we started removing /proc/acpi.
ie. we don't want to update the API, we want to delete it.

If this is a useful thing for user-space to know, then you need
to figure out a generic way to present it -- likely under
/sys/devices/system/cpu/

Andrew, please remove acpi-expose-_sun-in-proc-acpi-processor-info.patch
from the mm series.

thanks,
-

From: Alex Chiang
Date: Thursday, December 13, 2007 - 12:08 pm

Hi Len,

 
 
There are lots of ways to go with this, and I'd like to get an
idea of what you think makes most sense before going off and
spending tons of time here.

I see possible choices as:

  1) create something like:
  
	/sys/devices/system/cpu/cpuN/topology/socket_id

     And leave it up to the arch to figure if/how they want to
     implement it. On ia64 systems, we can get this information
     from the _SUN method.

  2) create something like:

  	/sys/devices/system/cpu/cpuN/acpi/

     And port over the stuff from /proc/acpi, adding in a new
     field for _SUN.

Thoughts?

Thanks.

/ac

--

Previous thread: [2.6 patch] make ata_scsi_lpm_get() static by Adrian Bunk on Tuesday, October 30, 2007 - 4:50 pm. (2 messages)

Next thread: Re: pdflush stuck in D state with v2.6.24-rc1-192-gef49c32 by Florin Iucha on Tuesday, October 30, 2007 - 5:02 pm. (3 messages)