lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 1 Nov 2007 15:29:14 +0000
From:	Ralf Baechle <ralf@...ux-mips.org>
To:	linux-kernel@...r.kernel.org
Subject: CLOCK_TICK_RATE in NTP code

kernel/time/ntp.c contains the following piece of code:

#define CLOCK_TICK_OVERFLOW     (LATCH * HZ - CLOCK_TICK_RATE)
#define CLOCK_TICK_ADJUST       (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / \
                                        (s64)CLOCK_TICK_RATE)

static void ntp_update_frequency(void)
{
        u64 second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ)
                                << TICK_LENGTH_SHIFT;
        second_length += (s64)CLOCK_TICK_ADJUST << TICK_LENGTH_SHIFT;
        second_length += (s64)time_freq << (TICK_LENGTH_SHIFT - SHIFT_NSEC);

        tick_length_base = second_length;

        do_div(second_length, HZ);
        tick_nsec = second_length >> TICK_LENGTH_SHIFT;

        do_div(tick_length_base, NTP_INTERVAL_FREQ);
}

So it uses CLOCK_TICK_RATE which on many systems but not all is defined to
the i8253 input clock.  But timekeeping on anything remotely modern makes
little use of the i8253 so I wonder the intent was here.

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

Powered by blists - more mailing lists