Re: How to get number of physical CPU in linux from user space?

From: chrisl@vmware.com
Date: Fri Oct 25 2002 - 14:07:03 EST


On Fri, Oct 25, 2002 at 01:38:57PM +0100, Dave Jones wrote:
>
> You can perform cpuid instructions in userspace to get the
> number of siblings per physical package.
>
Sure. But the problem is that we don't know for sure how many
of the sibling was enable in the kernel. Kernel support up to
2 siblings right now, but it might be more in later kernel. And
user might turn off sibling in kernel.

So divide the number of cpu in cpuinfo by number of siblings per
physical package do not work reliable.

Any comment to add one entry into /proc/cpuinfo to tell which physical
cpu it belong to? I don't mind submit a patch. It will be something
look like:

processor : 2
physical cpu : 1

Cheers

Chris

-
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/



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:28 EST