lkml.org 
[lkml]   [2005]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [discuss] [PATCH] Export cpu topology for IA32 and x86_64 by sysfs
Date
From
>>-----Original Message-----
>>From: Andi Kleen [mailto:ak@suse.de]
>>Sent: 2005年12月14日 11:51
>>To: Zhang, Yanmin
>>Cc: linux-kernel@vger.kernel.org; discuss@x86-64.org; Pallipadi, Venkatesh
>>Subject: Re: [discuss] [PATCH] Export cpu topology for IA32 and x86_64 by sysfs
>>
>>On Wed, Dec 14, 2005 at 11:11:00AM +0800, Zhang, Yanmin wrote:
>>> The patch exports the cpu topology info through sysfs on ia32/x86_64
>>> machines. The info is similar to /proc/cpuinfo.
>>>
>>> The exported items are:
>>> /sys/devices/system/cpu/cpuX/topology/physical_package_id(representing
>>> the physical package id of cpu X)
>>> /sys/devices/system/cpu/cpuX/topology/core_id (representing the cpu core
>>> id to cpu X)
>>> /sys/devices/system/cpu/cpuX/topology/thread_siblings (representing the
>>> thread siblings to cpu X)
>>> /sys/devices/system/cpu/cpuX/topology/core_siblings (represeting the
>>> core siblings to cpu X)
>>
>>Hmm, I'm not sure it is that useful. Did someone decide to move
>>all information from cpuinfo into sysfs?
It's more convenient for shell scripts to get cpu topology info from sysfs.

>>
>>And if it's done I think it needs Documentation somewhere.
There is no appropriate file to write down the info under Documentation.

>>
>>Anyways, the notifier is wrong. You need to handle CPU_UP_CANCELLED
>>too.
No. The node and related data are created/registered only when cpu is CPU_ONLINE. If CPU_UP_CANCELED is delivered to the notifier, the cpu is not online, and its node is not registered, so we needn't do anything when CPU_UP_CANCELED.

>>
>>And you could probably shrink the code size of the show function
>>in half by switching data instead of functions.
I don't quite understand what you said. My patch just uses the attribute address (a kind of data, not function) as parameter. If the function needs to be shrunken, I think I have to define a sub function per attribute which causes even longer code size.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-14 06:41    [W:0.048 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site