RE: [discuss] [PATCH] Export cpu topology for IA32 and x86_64 by sysfs

From: Pallipadi, Venkatesh
Date: Wed Dec 14 2005 - 20:38:29 EST




>-----Original Message-----
>From: Andi Kleen [mailto:ak@xxxxxxx]
>Sent: Tuesday, December 13, 2005 7:51 PM
>To: Zhang, Yanmin
>Cc: linux-kernel@xxxxxxxxxxxxxxx; discuss@xxxxxxxxxx;
>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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/