Re: kernel time *UNSAFE* during interrupts

Stephen Donnelly (sfd@cs.waikato.ac.nz)
Wed, 25 Nov 1998 21:30:33 +0000


Michael Krause wrote:
> The page says you printk()'ed the time from both get_fast_time() and
> do_gettimeofday() -- however, on a Pentium system with TSC enabled,
> get_fast_time() also ends up in do_gettimeofday() [do_get_fast_time
> gets overwritten at the bottom of arch/i386/kernel/time.c] so I don't
> quite see how you can get different results.

Ah, but I don't! do_gettimeofday and get_fast_time produce the same
results at interrupt time, both of them show the -10ms jump. It is only
from user space (or non-interrupt time?) that gettimeofday is safe.

> What a machine do you have, and is CONFIG_CPU_IS_SLOW enabled?

I have tried this on a PII 266MHz with 196MB of ram, and an old P75.
Both of these will have TSC.

I could not find the CONFIG_CPU_IS_SLOW option anywhere, where does it
get set or cleared?

I would very much like it if you could try the tcpdump experiment, so
that I can say that its not only me that sees this bug!

> Hmm. I was sure it's only a matter of time until someone finds a bug
> in the new time.c code :)

Ah well, this is the nature of things. :)

Stephen.

-- 
-----------------------------------------------------------------------
    Stephen Donnelly (BCMS)             email: sfd@cs.waikato.ac.nz
    Waikato ATM Group          Lab G1.31 phone +64 7 838 4466 x6728
    Computer Science Department, University of Waikato, New Zealand
-----------------------------------------------------------------------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/