Messages in this thread | | | Date | Thu, 10 Apr 2008 19:24:37 +0200 | From | "Bert Wesarg" <> | Subject | Re: [PATCH 1/3] x86: modify show_shared_cpu_map in intel_cacheinfo v3 |
| |
On Tue, Apr 8, 2008 at 10:44 PM, Mike Travis <travis@sgi.com> wrote: > Btw, you were asking about how to determine NR_CPUS. Here's one way: > > root@newton:~# cat /sys/devices/system/cpu/online > 0-2,4-7 > root@newton:~# cat /sys/devices/system/cpu/possible > 0-511 > root@newton:~# cat /sys/devices/system/cpu/present > 0-7 > root@newton:~# cat /sys/devices/system/cpu/system > 0-4095 I think its easier to count the commas from a cpumask file. Here you must parse a complete list expression, just to get the max id.
Either way, I think this isn't a very clean way.
Bert > Thanks, > Mike >
| |