Re: /proc/cpuinfo format - arch dependent!

From: Ricky Beam
Date: Fri May 06 2005 - 22:44:03 EST


On Tue, 19 Apr 2005, Nico Schottelius wrote:
>When I wrote schwanz3(*) for fun, I noticed /proc/cpuinfo
>varies very much on different architectures.

Yep, and it has been this way since the begining of time.

>So that one at least can count the cpus on every system the same way.

Hah. Give me a minute to stop laughing... I argued the same point almost
a decade ago. Linus decided to be an ass and flat refused to ever export
numcpu (or any of the current day derivatives) which brought us to the
bullshit of parsing the arch dependant /proc/cpuinfo.

Short of a kernel module to export the kernel variables, that's the only
damned way to find the number of cpus in a Linux system. I was bitched at
by other Distributed.net developers years ago for adding this sort of code
to count up the cpus under linux -- at the time, libc/glibc's sysconf()
didn't support getting cpu info under linux. Today, glibc's sysconf()
parses /proc/cpuinfo.

>If so, who would the one I should contact and who would accept / verify
>a patch doing that?

Linus has already spoken. Don't waste your time. (unless he's willing to
rethink this whole stupidity.)

Beyond counting cpus, each arch is reporting very different things, so
combining them into one general format really doesn't make sense. The
notion of putting all that info in sysfs space isn't bad except it takes
up a lot more memory.

--Ricky


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