RE: New Linux System time proposal

From: linux-os (linux-os_at_analogic.com)
Date: 01/19/05

  • Next message: Con Kolivas: "Re: [PATCH][RFC] sched: Isochronous class for unprivileged soft rt scheduling"
    Date:	Wed, 19 Jan 2005 08:56:00 -0500 (EST)
    To: Robert White <rwhite@casabyte.com>
    
    

    On Tue, 18 Jan 2005, Robert White wrote:

    > I thought it was not at all unusual to miss a jiffy here or there due
    > to interrupt
    > locking/latency; plus jiffies is expressed with respect to the value
    > of HZ so you
    > would need to do some deviding in there somewhere.
    >

    Makes no difference. The idea is that jiffies __never__ gets changed,
    ever.

    > Where HZ has been adjusted up, or on slower embedded boxes where
    > interrupts could be
    > blocked longer, you would lose time.
    >

    No difference. We should never touch the count in the master timer,
    jiffies. Never, never, ever.

    > Or are you not talking about real-word time?
    >

    That's what I said. When you need to read real-world time,
    you read the sum of bootime, time_adj, and jiffies. The
    time is read in the most natural dimension, not necessarily
    microsconds, it could be micro-croak-farts, a number dimension
    that results in the least number of lossy conversions.

    Boot time is read from the RTC (or other hardware clock) upon
    boot and never changed. Jiffies starts at 0 upon boot. Time_adj
    starts at 0 upon boot, but once the system is up it gets adjusted
    when the machine is set to some outside reference. This parameter
    is the only element that is ever adjusted. This is the only
    element that ever needs to be protected with a lock. It can
    certainly be dynamically adjusted (like adjtime) as well, but
    that's some other variables.

    Currently, if you do:

    extern void gettimeofday(void *); // Phony, yes
    int main()
    {
         int foo[0x10];
         for(;;)
             gettimeofday(foo);
    }

    An ordinary user can slow the system time about 10 seconds per
    hour doing this! I don't know if this qualifies as a DOS, but
    it isn't "nice".

    > Rob White,
    > Casabyte, Inc.
    >

    Cheers,
    *** Johnson
    Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
      Notice : All mail here is now cached for review by Dictator Bush.
                      98.36% of all statistics are fiction.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Con Kolivas: "Re: [PATCH][RFC] sched: Isochronous class for unprivileged soft rt scheduling"