mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix HZ leaking to userspace in BSD accounting
@ 2004-03-16 13:47 Tim Schmielau
  2004-03-19 14:09 ` [patch,rfc] BSD accounting format rework Tim Schmielau
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Schmielau @ 2004-03-16 13:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Arthur Corliss, Albert Cahalan, Ragnar Kjørstad, lkml

BSD accounting was missed in the conversion from HZ to USER_HZ.
I thought nobody cared, but apparently there are still users to it.

A larger patch with binary compatible 32 uid/gid support etc. is currently
cooking, but we want to fix this as soon as possible, before distris
pick up 2.6.

Thanks,
Tim


--- linux-2.6.5-rc1/kernel/acct.c	2004-03-11 10:33:04.000000000 +0100
+++ linux-2.6.5-rc1-acct/kernel/acct.c	2004-03-16 13:48:13.000000000 +0100
@@ -52,6 +52,7 @@
 #include <linux/security.h>
 #include <linux/vfs.h>
 #include <linux/jiffies.h>
+#include <linux/times.h>
 #include <asm/uaccess.h>
 #include <asm/div64.h>
 #include <linux/blkdev.h> /* sector_div */
@@ -336,13 +337,13 @@ static void do_acct_process(long exitcod
 
 	strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm));
 
-	elapsed = get_jiffies_64() - current->start_time;
+	elapsed = jiffies_64_to_clock_t(get_jiffies_64() - current->start_time);
 	ac.ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ?
 	                       (unsigned long) elapsed : (unsigned long) -1l);
-	do_div(elapsed, HZ);
+	do_div(elapsed, USER_HZ);
 	ac.ac_btime = xtime.tv_sec - elapsed;
-	ac.ac_utime = encode_comp_t(current->utime);
-	ac.ac_stime = encode_comp_t(current->stime);
+	ac.ac_utime = encode_comp_t(jiffies_to_clock_t(current->utime));
+	ac.ac_stime = encode_comp_t(jiffies_to_clock_t(current->stime));
 	/* we really need to bite the bullet and change layout */
 	ac.ac_uid = current->uid;
 	ac.ac_gid = current->gid;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-03-21  1:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-16 13:47 [PATCH] fix HZ leaking to userspace in BSD accounting Tim Schmielau
2004-03-19 14:09 ` [patch,rfc] BSD accounting format rework Tim Schmielau
2004-03-19 19:19   ` Ragnar Kjørstad
2004-03-19 21:14     ` Robin Holt
2004-03-21  1:28       ` Tim Schmielau
2004-03-21  1:21     ` Tim Schmielau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®