Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what's a "jiffy" in /proc?

1,555 views
Skip to first unread message

Virginie Galtier

unread,
Aug 31, 1999, 3:00:00 AM8/31/99
to
Hi

The proc man indicates that in /proc/<pid>/stat, utime is "The number of
jiffies that this process has been scheduled in user mode."

But I found 2 definitions for "jiffy" (in
http://foldoc.doc.ic.ac.uk/foldoc):

1. The duration of one tick of the computer's system clock.
2. Confusingly, the term is sometimes also used for a 1-millisecond wall
time interval.

So in the case of /proc/<pid>/stat, should I consider the first
definition or the second?

Thank you for your help

Virginie


Quiney, Philip (EXCHANGE:HAL02:HM10)

unread,
Sep 1, 1999, 3:00:00 AM9/1/99
to
Hi,

According to "Linux Device Drivers" by Alessandro Rubini a jiffy is
defined as follows

"....the timer interrupt, which is the mechanism the kernel uses to keep
track of time intervals. The timer interrupt is set to a default value
of HZ, which is architecture-dependant value defined in
<linux/param.h>."

It is defined as 100 for Intel/other platforms and 1024 for Alpha.

Basically every time the timer interrupt occurs the value of the
variable 'jiffies' is incremented. This value is used by the kernel and
other driver modules as required.

From this you can see thet the period is 1/100 sec (10msec) so your
original definition of 1/ is correct and 2/ is wrong (but would be OK if
it said 10msec).

Bear in mind that jiffies is defined as 'unsigned long' which will cause
it to roll over (after several hundred days - 497 IIRC). It is the
responsibility of the person writing code that makes use of 'jiffies' to
know about this and make an allowance for it - it is not unheard of for
Linux kernels to have this kind of uptime.

HTH

Regards

Phil Q

--

Phil Quiney Digital PowerLine,
pqu...@nortelnetworks.com Nortel Networks,
Telephone: +44 (1279) 402363 London Rd, Harlow,
Fax: +44 (1279) 402885 Essex CM17 9NA,
United Kingdom.

"This message may contain information proprietary to Northern
Telecom so any unauthorised disclosure, copying or distribution
of its contents is strictly prohibited."

David T. Blake

unread,
Sep 1, 1999, 3:00:00 AM9/1/99
to
Quiney, Philip (EXCHANGE:HAL02:HM10) <pqu...@nortelnetworks.com> wrote:
> Basically every time the timer interrupt occurs the value of
> the variable 'jiffies' is incremented. This value is used by the
> kernel and other driver modules as required.
>
> From this you can see thet the period is 1/100 sec (10msec) so
> your original definition of 1/ is correct and 2/ is wrong (but
> would be OK if it said 10msec).

You actually accumulate more HZ jiffies/second on Intel
architecture for each cpu.

--
Dave Blake
dbl...@phy.ucsf.edu

Mladen Gogala

unread,
Sep 6, 1999, 3:00:00 AM9/6/99
to
Virginie Galtier wrote:
>
> Hi
>
> The proc man indicates that in /proc/<pid>/stat, utime is "The number of
> jiffies that this process has been scheduled in user mode."
>
> But I found 2 definitions for "jiffy" (in
> http://foldoc.doc.ic.ac.uk/foldoc):
>
> 1. The duration of one tick of the computer's system clock.
> 2. Confusingly, the term is sometimes also used for a 1-millisecond wall
> time interval.
>
> So in the case of /proc/<pid>/stat, should I consider the first
> definition or the second?
>
> Thank you for your help
>
> Virginie
Jiffy is one tick of the system clock (10 msec).
--
Mladen Gogala


David T. Blake

unread,
Sep 6, 1999, 3:00:00 AM9/6/99
to
Mladen Gogala <mgo...@earthlink.net> wrote:
> Jiffy is one tick of the system clock (10 msec).

This is correct on single CPU non-alpha linux systems.

But a jiffy is not really a unit of time - more an
interrupt interval. You get twice as many jiffies per
second on a dual cpu system. Four times as many on
a quad, and >10 times as many on an alpha.

--
Dave Blake
dbl...@phy.ucsf.edu

0 new messages