RE: Reading /proc/stat is slooow

From: Luck, Tony <>
Date: 2005-12-06 12:21:19
>I just tried CONFIG_NR_CPUS=1024 ... and I don't see anything
>like a 20ms delay on 2.6.15-rc5.  How many actual cpus on your
>machine (I only have two on the machine where I tested)?

Ah ... but I didn't have CONFIG_HOTPLUG_CPU set ... so my
cpu_possible_map will have only had the two bits set for the
two cpus that exist in my system.  So I was only allocating
a small buffer in stat_open() [which is my best guess for why
you see more time ... with NR_CPUS=512 you are kmalloc'ing
a big hunk of memory].

With cpu hotplug and NR_CPUS=1024 I now see 53ms for the first
of the reads from /proc/stat (as reported by strace -T).

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Tue Dec 06 12:22:15 2005

This archive was generated by hypermail 2.1.8 : 2005-12-06 12:22:21 EST