Messages in this thread | | | Subject | RE: [discuss] [PATCH] Export cpu topology for IA32 and x86_64 by sysfs | Date | Wed, 14 Dec 2005 17:39:14 -0800 | From | "Pallipadi, Venkatesh" <> |
| |
>-----Original Message----- >From: Andi Kleen [mailto:ak@suse.de] >Sent: Tuesday, December 13, 2005 7:51 PM >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? >
Not really. The current display in /proc/cpuinfo, though useful for human reader, is not very friendly to scripts. And if one wants to find out which logical CPUs belong to the same core, there will have to be some amount of code in userlevel to parse the /proc/cpuinfo and get this info. So, we thought that it may be useful to export the masks to the user directly in a genric way. And, while doing that thinking was adding new fields in /sysfs rather than /proc/ was better.
Having said that, I feel Nathan's suggestion of doing it in more architecturally-neutral way should be better than this. We will have a relook at this one now.
And this needs some documentation changes as well.
Thanks for feedback. Venki - 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/
| |