19 Oct, 2007

2 commits

  • Signed-off-by: Daniel Walker
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Walker
     
  • On platforms that copy sys_tz into the vdso (currently only x86_64, soon to
    include powerpc), it is possible for the vdso to get out of sync if a user
    calls (admittedly unusual) settimeofday(NULL, ptr).

    This patch adds a hook for architectures that set
    CONFIG_GENERIC_TIME_VSYSCALL to ensure when sys_tz is updated they can also
    updatee their copy in the vdso.

    Signed-off-by: Tony Breeds
    Cc: Andi Kleen
    Cc: Tony Luck
    Acked-by: John Stultz
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tony Breeds
     

17 Oct, 2007

2 commits

  • This patch cleans up duplicate includes in
    kernel/

    Signed-off-by: Jesper Juhl
    Acked-by: Paul E. McKenney
    Reviewed-by: Satyam Sharma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • improve performance of sys_time(). sys_time() returns time in seconds,
    but it does so by calling do_gettimeofday() and then returning the
    tv_sec portion of the GTOD time. But the data structure "xtime", which
    is updated by every timer/scheduler tick, already offers HZ granularity
    time.

    the patch improves the sysbench oltp macrobenchmark by 4-5% on an AMD
    dual-core system:

    v2.6.23:

    #threads

    1: transactions: 4073 (407.23 per sec.)
    2: transactions: 8530 (852.81 per sec.)
    3: transactions: 8321 (831.88 per sec.)
    4: transactions: 8407 (840.58 per sec.)
    5: transactions: 8070 (806.74 per sec.)

    v2.6.23 + sys_time-speedup.patch:

    1: transactions: 4281 (428.09 per sec.)
    2: transactions: 8910 (890.85 per sec.)
    3: transactions: 8659 (865.79 per sec.)
    4: transactions: 8676 (867.34 per sec.)
    5: transactions: 8532 (852.91 per sec.)

    and by 4-5% on an Intel dual-core system too:

    2.6.23:

    1: transactions: 4560 (455.94 per sec.)
    2: transactions: 10094 (1009.30 per sec.)
    3: transactions: 9755 (975.36 per sec.)
    4: transactions: 9859 (985.78 per sec.)
    5: transactions: 9701 (969.72 per sec.)

    2.6.23 + sys_time-speedup.patch:

    1: transactions: 4779 (477.84 per sec.)
    2: transactions: 10103 (1010.14 per sec.)
    3: transactions: 10141 (1013.93 per sec.)
    4: transactions: 10371 (1036.89 per sec.)
    5: transactions: 10178 (1017.50 per sec.)

    (the more CPUs the system has, the more speedup this patch gives for
    this particular workload.)

    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

26 Jul, 2007

1 commit

  • This avoids use of the kernel-internal "xtime" variable directly outside
    of the actual time-related functions. Instead, use the helper functions
    that we already have available to us.

    This doesn't actually change any behaviour, but this will allow us to
    fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ
    (because much of the realtime information is maintained as separate
    offsets to 'xtime'), which has caused interfaces that use xtime directly
    to get a time that is out of sync with the real-time clock by up to a
    third of a second or so.

    Signed-off-by: John Stultz
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    john stultz
     

21 Jul, 2007

2 commits

  • This basically reverts commit 4e44f3497d41db4c3b9051c61410dee8ae4fb49c,
    while waiting for it to be re-done more completely. There are cases of
    people mixing "time()" with higher-resolution time sources, and we need
    to take the nanosecond offsets into account.

    Ingo has a patch that does that, but it's still under some discussion.
    In the meantime, just revert back to the old simple situation of just
    doing the whole exact timesource calculations.

    But rather than using do_gettimeofday(), use the internal nanosecond
    resolution getnstimeofday(), which at least avoids one unnecessary
    conversion (since we really don't care about whether the fractional
    seconds are nanoseconds or microseconds - we'll just throw them away).

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Remove time_interpolator code (This is generic code, but
    only user was ia64. It has been superseded by the
    CONFIG_GENERIC_TIME code).

    Signed-off-by: Bob Picco
    Signed-off-by: John Stultz
    Signed-off-by: Peter Keilty
    Signed-off-by: Tony Luck

    Bob Picco
     

17 Jul, 2007

1 commit

  • Improve performance of sys_time(). sys_time() returns time in seconds, but
    it does so by calling do_gettimeofday() and then returning the tv_sec
    portion of the GTOD time. But the data structure "xtime", which is updated
    by every timer/scheduler tick, already offers HZ granularity time.

    The patch improves the sysbench OLTP macrobenchmark significantly:

    2.6.22-rc6:

    #threads
    1: transactions: 3733 (373.21 per sec.)
    2: transactions: 6676 (667.46 per sec.)
    3: transactions: 6957 (695.50 per sec.)
    4: transactions: 7055 (705.48 per sec.)
    5: transactions: 6596 (659.33 per sec.)

    2.6.22-rc6 + sys_time.patch:

    1: transactions: 4005 (400.47 per sec.)
    2: transactions: 7379 (737.77 per sec.)
    3: transactions: 7347 (734.49 per sec.)
    4: transactions: 7468 (746.65 per sec.)
    5: transactions: 7428 (742.47 per sec.)

    Mixed API uses of gettimeofday() and time() are guaranteed to be coherent
    via the use of a at-most-once-per-second slowpath that updates xtime.

    [akpm@linux-foundation.org: build fixes]
    Signed-off-by: Ingo Molnar
    Cc: John Stultz
    Cc: Thomas Gleixner
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

09 May, 2007

2 commits

  • Remove includes of where it is not used/needed.
    Suggested by Al Viro.

    Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
    sparc64, and arm (all 59 defconfigs).

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • The first thing done by timespec_trunc() is :

    if (gran
    imul $0x3e8,%eax,%eax
    cmp %ebx,%eax

    This patch reorders kernel/time.c a bit so that jiffies_to_usecs() is defined
    before timespec_trunc() so that compiler now generates :

    cmp $0x3d0900,%edx (HZ=250 on my machine)

    This gives a better code (timespec_trunc() becoming a leaf function), and
    shorter kernel size as well.

    Signed-off-by: Eric Dumazet
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: john stultz
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

26 Apr, 2007

2 commits

  • Change tcp_probe to use ktime (needed to add one export).
    Add option to only get events when cwnd changes - from Doug Leith

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • We currently use a special structure (struct skb_timeval) and plain
    'struct timeval' to store packet timestamps in sk_buffs and struct
    sock.

    This has some drawbacks :
    - Fixed resolution of micro second.
    - Waste of space on 64bit platforms where sizeof(struct timeval)=16

    I suggest using ktime_t that is a nice abstraction of high resolution
    time services, currently capable of nanosecond resolution.

    As sizeof(ktime_t) is 8 bytes, using ktime_t in 'struct sock' permits
    a 8 byte shrink of this structure on 64bit architectures. Some other
    structures also benefit from this size reduction (struct ipq in
    ipv4/ip_fragment.c, struct frag_queue in ipv6/reassembly.c, ...)

    Once this ktime infrastructure adopted, we can more easily provide
    nanosecond resolution on top of it. (ioctl SIOCGSTAMPNS and/or
    SO_TIMESTAMPNS/SCM_TIMESTAMPNS)

    Note : this patch includes a bug correction in
    compat_sock_get_timestamp() where a "err = 0;" was missing (so this
    syscall returned -ENOENT instead of 0)

    Signed-off-by: Eric Dumazet
    CC: Stephen Hemminger
    CC: John find
    Signed-off-by: David S. Miller

    Eric Dumazet
     

05 Apr, 2007

1 commit

  • This patch adds 2 missing symbol exports: jiffies_to_timeval() and
    timeval_to_jiffies(). The (not yet merged) dm-raid4-5 module will need
    them, and they used to be indirectly exported by virtue of being inline
    functions.

    Commit 8b9365d753d9870bb6451504c13570b81923228f ("[PATCH] Uninline
    jiffies.h functions") uninlined them, and thus modules now need them
    explicitly exported to use them.

    Signed-off-by: Thomas Bittermann
    Acked-by: Andrew Morton
    Acked-by: Ingo Molnar
    Acked-by: Thomas Gleixner
    Acked-by: john stultz
    Signed-off-by: Linus Torvalds

    Thomas Bittermann
     

17 Feb, 2007

2 commits

  • Fix multiple conversion bugs in msecs_to_jiffies().

    The main problem is that this condition:

    if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET))

    overflows if HZ is smaller than 1000!

    This change is user-visible: for HZ=250 SUS-compliant poll()-timeout
    value of -20 is mistakenly converted to 'immediate timeout'.

    (The new dyntick code also triggered this, that's how we noticed.)

    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner
    Cc: john stultz
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • There are loads of fat functions hidden in jiffies.h. Uninline them. No code
    changes.

    [jeremy@goop.org: export fix]
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner
    Cc: john stultz
    Cc: Roman Zippel
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

01 Oct, 2006

1 commit


27 Jun, 2006

1 commit


01 Apr, 2006

1 commit

  • I was grepping through the code and some `grep ganularity -R .` didn't
    catch what I thought. Then looking closer I saw the term "granuality"
    used in only four places (in comments) and granularity in many more
    places describing the same idea. Some other facts:

    dictionary.com does not know such a word
    define:granuality on google is not found (and pages for granuality are
    mostly related to patches to the kernel)
    it has not been discussed as a term on LKML, AFAICS (=Can Search)

    To be consistent, I think granularity should be used everywhere.

    Signed-off-by: Kalin KOZHUHAROV
    Signed-off-by: Adrian Bunk

    Kalin KOZHUHAROV
     

27 Mar, 2006

1 commit

  • nsec_t predates ktime_t and has mostly been superseded by it. In the few
    places that are left it's better to make it explicit that we're dealing with
    64 bit values here.

    Signed-off-by: Roman Zippel
    Acked-by: Thomas Gleixner
    Acked-by: John Stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     

26 Mar, 2006

1 commit

  • This removes the support for pps. It's completely unused within the kernel
    and is basically in the way for further cleanups. It should be easier to
    readd proper support for it after the rest has been converted to NTP4
    (where the pps mechanisms are quite different from NTP3 anyway).

    Signed-off-by: Roman Zippel
    Cc: Adrian Bunk
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     

04 Feb, 2006

1 commit


01 Feb, 2006

1 commit


12 Jan, 2006

1 commit

  • - Move capable() from sched.h to capability.h;

    - Use where capable() is used
    (in include/, block/, ipc/, kernel/, a few drivers/,
    mm/, security/, & sound/;
    many more drivers/ to go)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy.Dunlap
     

11 Jan, 2006

6 commits


13 Dec, 2005

1 commit

  • There are several functions that might seem appropriate for a timestamp:

    get_cycles()
    current_kernel_time()
    do_gettimeofday()

    Each has problems with combinations of SMP-safety, low resolution, and
    monotonicity. This patch adds a new function that returns a monotonic SMP-safe
    timestamp with nanosecond resolution where available.

    Changes:
    Split timestamp into separate patch
    Moved to kernel/time.c
    Renamed to getnstimestamp
    Fixed unintended-pointer-arithmetic bug

    Signed-off-by: Matt Helsley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Helsley
     

31 Oct, 2005

1 commit

  • Create a macro shift_right() that avoids the numerous ugly conditionals in the
    NTP code that look like:

    if(a < 0)
    b = -(-a >> shift);
    else
    b = a >> shift;

    Replacing it with:

    b = shift_right(a, shift);

    This should have zero effect on the logic, however it should probably have
    a bit of testing just to be sure.

    Also replace open-coded min/max with the macros.

    Signed-off-by : John Stultz

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    john stultz
     

30 Oct, 2005

1 commit


15 Oct, 2005

1 commit


28 Jul, 2005

1 commit

  • `gcc -W' likes to complain if the static keyword is not at the beginning of
    the declaration. This patch fixes all remaining occurrences of "inline
    static" up with "static inline" in the entire kernel tree (140 occurrences in
    47 files).

    While making this change I came across a few lines with trailing whitespace
    that I also fixed up, I have also added or removed a blank line or two here
    and there, but there are no functional changes in the patch.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     

28 Apr, 2005

1 commit

  • settimeofday will set the time a little bit too early on systems using
    time interpolation since it subtracts the current interpolator offset
    from the time. This used to be necessary with the code in 2.6.9 and earlier
    but the new code resets the time interpolator after setting the time.
    Thus the time is set too early and gettimeofday will return a time slightly
    before the time specified with settimeofday if invoked immeditely after
    settimeofday.

    This removes the obsolete subtraction of the time interpolator offset
    and makes settimeofday set the time accurately.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds