Re: finding out the value of HZ from userspace

From: Peter Williams (peterw_at_aurema.com)
Date: 03/16/04

  • Next message: Jeff Garzik: "Re: Prism54 Driver Project Complete"
    Date:	Tue, 16 Mar 2004 16:53:25 +1100
    To: Andi Kleen <ak@muc.de>
    
    

    Andi Kleen wrote:
    > Peter Williams <peterw@aurema.com> writes:
    >
    >
    >>This horrible hack of converting all tick values to 100 (from 1000)
    >>for export to user space because a large number of user space programs
    >>assume that HZ is 100 would NOT be necessary if there was a mechanism
    >>whereby user space programs could find out how many ticks there are in
    >>a second instead of having to make assumptions.
    >
    >
    > Already exists for a long time - AT_CLKTCK. glibc has a nice wrapper
    > for it too (sysconf)

    So it does and POSIX.1 (_SC_CLK_TCK) compliant as well. Unfortunately,
    the presence of this functionality makes it VERY difficult to understand
    why ticks are being converted from HZ==1000 values to HZ=100 values when
    they are being exported to user space especially as this conversion
    throws away precision. Can anyone enlighten me?

    Peter

    -- 
    Dr Peter Williams, Chief Scientist                peterw@aurema.com
    Aurema Pty Limited                                Tel:+61 2 9698 2322
    PO Box 305, Strawberry Hills NSW 2012, Australia  Fax:+61 2 9699 9174
    79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com
    -
    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: Jeff Garzik: "Re: Prism54 Driver Project Complete"

    Relevant Pages

    • Re: finding out the value of HZ from userspace
      ... export to user space because a large number of user space programs ... Another alternative would be to stop exporting time as ticks and use ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: finding out the value of HZ from userspace
      ... >>export to user space because a large number of user space programs ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: finding out the value of HZ from userspace
      ... Peter Williams writes: ... > for export to user space because a large number of user space programs ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: finding out the value of HZ from userspace
      ... > export to user space because a large number of user space programs ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: [RFC] SPI core -- revisited
      ... >DMA to copy data from user to kernel space? ... >cause page faults which ensure that the user space pages are paged in ... where dev is actually an SPI device. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)