Re: 2.4.23-ck1

From: Tim Schmielau
Date: Thu Dec 04 2003 - 08:32:34 EST


On Thu, 4 Dec 2003, Con Kolivas wrote:

> On Thu, 4 Dec 2003 21:43, Tvrtko A. UrÅulin wrote:
> > There is something wrong with /proc/stat which confuses xosview and
> > ksysguard regarding CPU usage. Top is working ok.
> >
> > tvrtko@oxygene:~> cat /proc/stat
> > cpu 7452 0 2048 40426
> > cpu0 7452 0 2048 1844674407370950652
>
> You're right. This looks like a hangover from the 64bit jiffies or the
> variable Hz. It's not a critical bug so unless someone can debug it for me it
> can wait.

Oops, yes. I made a mistake when merging variable HZ with 64bit jiffies.
Please apply the following patch on top of that.
Could you please confirm this fixes things, and could you also check that
btime stays constant with this patch? Thanks!

Warning: totally untested. Pretty much obvious, however.

Sorry,
Tim


--- linux-2.4.23-ck1/fs/proc/proc_misc.c 2003-12-04 14:15:59.000000000 +0100
+++ linux-2.4.23-ck1-fix/fs/proc/proc_misc.c 2003-12-04 14:20:07.000000000 +0100
@@ -422,7 +422,7 @@
(unsigned long long) jiffies_64_to_clock_t(user),
(unsigned long long) jiffies_64_to_clock_t(nice),
(unsigned long long) jiffies_64_to_clock_t(system),
- (unsigned long long) jiffies_64_to_clock_t(jif - user - nice - system));
+ (unsigned long long) jif - jiffies_64_to_clock_t(user + nice + system));
}
proc_sprintf(page, &off, &len,
"page %u %u\n"
@@ -460,7 +460,7 @@
}
}

- do_div(jif, HZ);
+ do_div(jif, USER_HZ);
proc_sprintf(page, &off, &len,
"\nctxt %lu\n"
"btime %lu\n"
-
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/