mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* HZ value used in kernel/acct.c
@ 2002-02-24 21:35 Tim Schmielau
  2002-02-25 20:44 ` Ragnar Hojland Espinosa
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Schmielau @ 2002-02-24 21:35 UTC (permalink / raw)
  To: linux-kernel

What is the supposed unit of the ac_etime field of struct acct?
The code in kernel/acct.c currently says

   ac.ac_etime = encode_comp_t(jiffies - current->start_time);

so it is given in multiples of HZ, which makes this value 
platform-dependent (and subject of overflow after 48.5 days with HZ=1024). 
In include/linux/acct.h however there is the definition

   #define AHZ             100

which somehow smells like the preferred time unit.
Comments?

Tim


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

* Re: HZ value used in kernel/acct.c
  2002-02-24 21:35 HZ value used in kernel/acct.c Tim Schmielau
@ 2002-02-25 20:44 ` Ragnar Hojland Espinosa
  2002-02-26  8:52   ` Tim Schmielau
  0 siblings, 1 reply; 3+ messages in thread
From: Ragnar Hojland Espinosa @ 2002-02-25 20:44 UTC (permalink / raw)
  To: Tim Schmielau; +Cc: linux-kernel

On Sun, Feb 24, 2002 at 10:35:33PM +0100, Tim Schmielau wrote:
> What is the supposed unit of the ac_etime field of struct acct?
> The code in kernel/acct.c currently says
> 
>    ac.ac_etime = encode_comp_t(jiffies - current->start_time);
> 
> so it is given in multiples of HZ, which makes this value 
> platform-dependent (and subject of overflow after 48.5 days with HZ=1024). 
> In include/linux/acct.h however there is the definition
> 
>    #define AHZ             100
> 
> which somehow smells like the preferred time unit.
> Comments?

The acct.c implementation followed FreeBSD's which also expressed comp_t
in terms platform dependant 1/(A)HZ   You could check the "[Patch] fix
incorrect jiffies compares" thread for a fix on uptime and 64 bit jiffies
someone sent.. didn't pay attention in why it didn't get in, tho.

-- 
____/|  Ragnar Højland      Freedom - Linux - OpenGL |    Brainbench MVP
\ o.O|  PGP94C4B2F0D27DE025BE2302C104B78C56 B72F0822 | for Unix Programming
 =(_)=  "Thou shalt not follow the NULL pointer for  | (www.brainbench.com)
   U     chaos and madness await thee at its end."      [20 pend. Mar 10]

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

* Re: HZ value used in kernel/acct.c
  2002-02-25 20:44 ` Ragnar Hojland Espinosa
@ 2002-02-26  8:52   ` Tim Schmielau
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Schmielau @ 2002-02-26  8:52 UTC (permalink / raw)
  To: Ragnar Hojland Espinosa; +Cc: linux-kernel

On Mon, 25 Feb 2002, Ragnar Hojland Espinosa wrote:
> On Sun, Feb 24, 2002 at 10:35:33PM +0100, Tim Schmielau wrote:
> > What is the supposed unit of the ac_etime field of struct acct?
[...]
> 
> The acct.c implementation followed FreeBSD's which also expressed comp_t
> in terms platform dependant 1/(A)HZ   You could check the "[Patch] fix
> incorrect jiffies compares" thread for a fix on uptime and 64 bit jiffies
> someone sent.. didn't pay attention in why it didn't get in, tho.
> 
Actually it was me who started the thread :-)
The question arose when I went over the patch to do a final version for 
submission to Marcelo and noticed that the 32bit values would overflow on 
alpha after 48.5 days even with my patch.

However, there seems to be so little response that I will probably just 
leave it the way it is now.

Tim


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

end of thread, other threads:[~2002-02-26  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-24 21:35 HZ value used in kernel/acct.c Tim Schmielau
2002-02-25 20:44 ` Ragnar Hojland Espinosa
2002-02-26  8:52   ` 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®