Skip to contentSkip to conversation

Patch linux so that /proc/stat shows all -- not just online -- CPUs.

Xen-changelog Muli Ben-Yehuda 2 participants 2 messages May 23, 2006 – May 26, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 15 lines · Xen patchbot-unstable

# HG changeset patch
# User [email protected]
# Node ID c6da0c5b03ffec5ce4130aeba90a49f218772622
# Parent dec7f819293c11f88281aa0fe408a10f8c1345ce
Patch linux so that /proc/stat shows all -- not just online -- CPUs. This way, tools such as TOP don't freak out when CPUs are hotplugged.

---
 patches/linux-2.6.16.13/xen-hotplug.patch |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -r dec7f819293c -r c6da0c5b03ff patches/linux-2.6.16.13/xen-hotplug.patch

patches/linux-2.6.16.13/xen-hotplug.patch new file +1 -0
@@ -0,0 +1,11 @@
+--- ../pristine-linux-2.6.16.13/fs/proc/proc_misc.c	2006-05-02 22:38:44.000000000 +0100

patches/linux-2.6.16.13/xen-hotplug.patch line 11

Quoted 10 lines
patches/linux-2.6.16.13/xen-hotplug.patch new file +10 -0
++++ ./fs/proc/proc_misc.c	2006-05-22 15:29:34.000000000 +0100
+@@ -433,7 +433,7 @@ static int show_stat(struct seq_file *p,
+ 		(unsigned long long)cputime64_to_clock_t(irq),
+ 		(unsigned long long)cputime64_to_clock_t(softirq),
+ 		(unsigned long long)cputime64_to_clock_t(steal));
+-	for_each_online_cpu(i) {
++	for_each_cpu(i) {
+ 
+ 		/* Copy values here to work around gcc-2.95.3, gcc-2.96 */
+ 		user = kstat_cpu(i).cpustat.user;

This doesn't appear to be Xen specific at all - has it been sent upstream?

Cheers,
Muli

#2 lore raw
In reply to a message not in the archive
Quoted 2 lines · Xen patchbot-unstable

Patch linux so that /proc/stat shows all -- not just online -- CPUs. This way, tools such as TOP don't freak out when CPUs are hotplugged.

It might still freak out though, when it runs into a CPU which has never changing times.

There's probably a way to trigger a divide by zero in some utility - but those will just have to be fixed ;)

Signature · 1 line
All Rights Reversed