Re: [PATCH 1/3] x86: modify show_shared_cpu_map in intel_cacheinfo v3

From: Bert Wesarg
Date: Thu Apr 10 2008 - 13:24:52 EST


On Tue, Apr 8, 2008 at 10:44 PM, Mike Travis <travis@xxxxxxx> 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
>
--
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/