29 Nov, 2011

1 commit


19 Nov, 2011

1 commit

  • __remove_hrtimer() attempts to reprogram the clockevent device when
    the timer being removed is the next to expire. However,
    __remove_hrtimer() reprograms the clockevent *before* removing the
    timer from the timerqueue and thus when hrtimer_force_reprogram()
    finds the next timer to expire it finds the timer we're trying to
    remove.

    This is especially noticeable when the system switches to NOHz mode
    and the system tick is removed. The timer tick is removed from the
    system but the clockevent is programmed to wakeup in another HZ
    anyway.

    Silence the extra wakeup by removing the timer from the timerqueue
    before calling hrtimer_force_reprogram() so that we actually program
    the clockevent for the next timer to expire.

    This was broken by 998adc3 "hrtimers: Convert hrtimers to use
    timerlist infrastructure".

    Signed-off-by: Jeff Ohlstein
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/1321660030-8520-1-git-send-email-johlstei@codeaurora.org
    Signed-off-by: Thomas Gleixner

    Jeff Ohlstein
     

31 Oct, 2011

1 commit

  • The changed files were only including linux/module.h for the
    EXPORT_SYMBOL infrastructure, and nothing else. Revector them
    onto the isolated export header for faster compile times.

    Nothing to see here but a whole lot of instances of:

    -#include
    +#include

    This commit is only changing the kernel dir; next targets
    will probably be mm, fs, the arch dirs, etc.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

26 May, 2011

1 commit

  • commit 9ec2690758a5 ("timerfd: Manage cancelable timers in timerfd")
    introduced a CONFIG_HIGHRES_TIMERS (should be CONFIG_HIGH_RES_TIMERS)
    typo, which caused applications depending on CLOCK_REALTIME timers to
    become sluggy due to the fact that the time base of the realtime
    timers was not updated when the wall clock time was set.

    This causes anything from 100% CPU use for some applications to odd
    delays and hickups.

    Reported-bisected-and-tested-by: Anca Emanuel
    Tested-by: Linus Torvalds
    Fatfingered-by: Thomas Gleixner
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

23 May, 2011

3 commits

  • The ordering of the clock bases is historical due to the
    CLOCK_REALTIME and CLOCK_MONOTONIC constants. Now the hrtimer bases
    have their own enumeration due to the gap between CLOCK_MONOTONIC and
    CLOCK_BOOTTIME. So we can be more clever as most timers end up on the
    CLOCK_MONOTONIC base due to the virtue of POSIX declaring that
    relative CLOCK_REALTIME timers are not affected by time changes. In
    desktop environments this is slowly changing as applications switch to
    absolute timers, but I've observed empty CLOCK_REALTIME bases often
    enough. There is no performance penalty or overhead when
    CLOCK_REALTIME timers are active, but in case they are not we don't
    skip over a full cache line.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Peter Zijlstra

    Thomas Gleixner
     
  • Instead of iterating over all possible timer bases avoid it by marking
    the active bases in the cpu base.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Peter Zijlstra

    Thomas Gleixner
     
  • Peter is concerned about the extra scan of CLOCK_REALTIME_COS in the
    timer interrupt. Yes, I did not think about it, because the solution
    was so elegant. I didn't like the extra list in timerfd when it was
    proposed some time ago, but with a rcu based list the list walk it's
    less horrible than the original global lock, which was held over the
    list iteration.

    Requested-by: Peter Zijlstra
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Peter Zijlstra

    Thomas Gleixner
     

03 May, 2011

3 commits

  • Some applications must be aware of clock realtime being set
    backward. A simple example is a clock applet which arms a timer for
    the next minute display. If clock realtime is set backward then the
    applet displays a stale time for the amount of time which the clock
    was set backwards. Due to that applications poll the time because we
    don't have an interface.

    Extend the timerfd interface by adding a flag which puts the timer
    onto a different internal realtime clock. All timers on this clock are
    expired whenever the clock was set.

    The timerfd core records the monotonic offset when the timer is
    created. When the timer is armed, then the current offset is compared
    to the previous recorded offset. When it has changed, then
    timerfd_settime returns -ECANCELED. When a timer is read the offset is
    compared and if it changed -ECANCELED returned to user space. Periodic
    timers are not rearmed in the cancelation case.

    Signed-off-by: Thomas Gleixner
    Acked-by: John Stultz
    Cc: Chris Friesen
    Tested-by: Kay Sievers
    Cc: "Kirill A. Shutemov"
    Cc: Peter Zijlstra
    Cc: Davide Libenzi
    Reviewed-by: Alexander Shishkin
    Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1104271359580.3323%40ionos%3E
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Make clock_was_set() unconditional and rename hres_timers_resume to
    hrtimers_resume. This is a preparatory patch for hrtimers which are
    cancelled when clock realtime was set.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Signed-off-by: Mike Frysinger
    Link: http://lkml.kernel.org/r/%3C1304364267-14489-1-git-send-email-vapier%40gentoo.org%3E
    Signed-off-by: Thomas Gleixner

    Mike Frysinger
     

29 Apr, 2011

1 commit

  • Sedat and Bruno reported RCU stalls which turned out to be caused by
    the following;

    sched_init() calls init_rt_bandwidth() which calls hrtimer_init()
    _BEFORE_ hrtimers_init() is called. While not entirely correct this
    worked because hrtimer_init() only accessed statically initialized
    data (hrtimer_bases.clock_base[CLOCK_MONOTONIC])

    Commit e06383db9 (hrtimers: extend hrtimer base code to handle more
    then 2 clockids) added an indirection to the hrtimer_bases.clock_base
    lookup to avoid gap handling in the hot path. The table which is used
    for the translataion from CLOCK_ID to HRTIMER_BASE index is
    initialized at runtime in hrtimers_init(). So the early call of the
    scheduler code translates CLOCK_MONOTONIC to HRTIMER_BASE_REALTIME.

    Thus the rt_bandwith timer ends up on CLOCK_REALTIME. If the timer is
    armed and the wall clock time is set (e.g. ntpdate in the early boot
    process - which also gives the problem deterministic behaviour
    i.e. magic recovery after N hours), then the timer ends up with an
    expiry time far into the future. That breaks the RT throttler
    mechanism as rt runtime is accumulated and never cleared, so the rt
    throttler detects a false cpu hog condition and blocks all RT tasks
    until the timer finally expires. That in turn stalls the RCU thread of
    TINYRCU which leads to an huge amount of RCU callbacks piling up.

    Make the translation table statically initialized, so we are back to
    the status of
    Reported-by: Bruno Prémont
    Cc: John stultz
    Cc: Mike Galbraith
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1104282353140.3005%40ionos%3E
    Reviewed-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

16 Mar, 2011

1 commit

  • …l/git/tip/linux-2.6-tip

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (62 commits)
    posix-clocks: Check write permissions in posix syscalls
    hrtimer: Remove empty hrtimer_init_hres_timer()
    hrtimer: Update hrtimer->state documentation
    hrtimer: Update base[CLOCK_BOOTTIME].offset correctly
    timers: Export CLOCK_BOOTTIME via the posix timers interface
    timers: Add CLOCK_BOOTTIME hrtimer base
    time: Extend get_xtime_and_monotonic_offset() to also return sleep
    time: Introduce get_monotonic_boottime and ktime_get_boottime
    hrtimers: extend hrtimer base code to handle more then 2 clockids
    ntp: Remove redundant and incorrect parameter check
    mn10300: Switch do_timer() to xtimer_update()
    posix clocks: Introduce dynamic clocks
    posix-timers: Cleanup namespace
    posix-timers: Add support for fd based clocks
    x86: Add clock_adjtime for x86
    posix-timers: Introduce a syscall for clock tuning.
    time: Splitout compat timex accessors
    ntp: Add ADJ_SETOFFSET mode bit
    time: Introduce timekeeping_inject_offset
    posix-timer: Update comment
    ...

    Fix up new system-call-related conflicts in
    arch/x86/ia32/ia32entry.S
    arch/x86/include/asm/unistd_32.h
    arch/x86/include/asm/unistd_64.h
    arch/x86/kernel/syscall_table_32.S
    (name_to_handle_at()/open_by_handle_at() vs clock_adjtime()), and some
    due to movement of get_jiffies_64() in:
    kernel/time.c

    Linus Torvalds
     

11 Mar, 2011

1 commit


08 Mar, 2011

1 commit

  • In complex subsystems like mac80211 structures can contain several
    timers and work structs, so identifying a specific instance from the
    call trace and object type output of debugobjects can be hard.

    Allow the subsystems which support debugobjects to provide a hint
    function. This function returns a pointer to a kernel address
    (preferrably the objects callback function) which is printed along
    with the debugobjects type.

    Add hint methods for timer_list, work_struct and hrtimer.

    [ tglx: Massaged changelog, made it compile ]

    Signed-off-by: Stanislaw Gruszka
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Stanislaw Gruszka
     

03 Mar, 2011

1 commit

  • We calculate the current time of each clock base by adding an offset
    to clock_monotonic. The offset for the clock bases is set in
    retrigger_next_event() which is called when we switch a cpu to highres
    mode or when the clock was set.

    Add the missing update for clock boottime.

    Signed-off-by: Thomas Gleixner
    Cc: John Stultz

    Thomas Gleixner
     

22 Feb, 2011

3 commits

  • CLOCK_MONOTONIC stops while the system is in suspend. This is because
    to applications system suspend is invisible. However, there is a
    growing set of applications that are wanting to be suspend-aware,
    but do not want to deal with the complications of CLOCK_REALTIME
    (which might jump around if settimeofday is called).

    For these applications, I propose a new clockid: CLOCK_BOOTTIME.
    CLOCK_BOOTTIME is idential to CLOCK_MONOTONIC, except it also
    includes any time spent in suspend.

    This patch add hrtimer base for CLOCK_BOOTTIME, using
    get_monotonic_boottime/ktime_get_boottime, to allow
    in kernel users to set timers against.

    CC: Jamie Lokier
    CC: Thomas Gleixner
    CC: Alexander Shishkin
    CC: Arve Hjønnevåg
    Signed-off-by: John Stultz

    John Stultz
     
  • Extend get_xtime_and_monotonic_offset to
    get_xtime_and_monotonic_and_sleep_offset().

    CC: Jamie Lokier
    CC: Thomas Gleixner
    CC: Alexander Shishkin
    CC: Arve Hjønnevåg
    Signed-off-by: John Stultz

    John Stultz
     
  • The hrtimer code is written mainly with CLOCK_REALTIME and CLOCK_MONOTONIC
    in mind. These are clockids 0 and 1 resepctively. However, if we are
    to introduce any new hrtimer bases, using new clockids, we have to skip
    the cputimers (clockids 2,3) as well as other clockids that may not impelement
    timers.

    This patch adds a little bit of indirection between the clockid and
    the base, so that we can extend the base by one when we add
    a new clockid at number 7 or so.

    CC: Jamie Lokier
    CC: Thomas Gleixner
    CC: Alexander Shishkin
    CC: Arve Hjønnevåg
    Signed-off-by: John Stultz

    John Stultz
     

31 Jan, 2011

1 commit

  • The hrtimer code accesses timekeeping variables under
    xtime_lock. Provide a sensible accessor function and use it.

    [ tglx: Removed the conditionals, unused variable, fixed codingstyle
    and massaged changelog ]

    Signed-off-by: Torben Hohn
    Cc: Peter Zijlstra
    Cc: johnstul@us.ibm.com
    Cc: yong.zhang0@gmail.com
    Cc: hch@infradead.org
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Torben Hohn
     

14 Jan, 2011

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    Documentation/trace/events.txt: Remove obsolete sched_signal_send.
    writeback: fix global_dirty_limits comment runtime -> real-time
    ppc: fix comment typo singal -> signal
    drivers: fix comment typo diable -> disable.
    m68k: fix comment typo diable -> disable.
    wireless: comment typo fix diable -> disable.
    media: comment typo fix diable -> disable.
    remove doc for obsolete dynamic-printk kernel-parameter
    remove extraneous 'is' from Documentation/iostats.txt
    Fix spelling milisec -> ms in snd_ps3 module parameter description
    Fix spelling mistakes in comments
    Revert conflicting V4L changes
    i7core_edac: fix typos in comments
    mm/rmap.c: fix comment
    sound, ca0106: Fix assignment to 'channel'.
    hrtimer: fix a typo in comment
    init/Kconfig: fix typo
    anon_inodes: fix wrong function name in comment
    fix comment typos concerning "consistent"
    poll: fix a typo in comment
    ...

    Fix up trivial conflicts in:
    - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
    - fs/ext4/ext4.h

    Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.

    Linus Torvalds
     

08 Jan, 2011

1 commit

  • * 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (30 commits)
    gameport: use this_cpu_read instead of lookup
    x86: udelay: Use this_cpu_read to avoid address calculation
    x86: Use this_cpu_inc_return for nmi counter
    x86: Replace uses of current_cpu_data with this_cpu ops
    x86: Use this_cpu_ops to optimize code
    vmstat: User per cpu atomics to avoid interrupt disable / enable
    irq_work: Use per cpu atomics instead of regular atomics
    cpuops: Use cmpxchg for xchg to avoid lock semantics
    x86: this_cpu_cmpxchg and this_cpu_xchg operations
    percpu: Generic this_cpu_cmpxchg() and this_cpu_xchg support
    percpu,x86: relocate this_cpu_add_return() and friends
    connector: Use this_cpu operations
    xen: Use this_cpu_inc_return
    taskstats: Use this_cpu_ops
    random: Use this_cpu_inc_return
    fs: Use this_cpu_inc_return in buffer.c
    highmem: Use this_cpu_xx_return() operations
    vmstat: Use this_cpu_inc_return for vm statistics
    x86: Support for this_cpu_add, sub, dec, inc_return
    percpu: Generic support for this_cpu_add, sub, dec, inc_return
    ...

    Fixed up conflicts: in arch/x86/kernel/{apic/nmi.c, apic/x2apic_uv_x.c, process.c}
    as per Tejun.

    Linus Torvalds
     

07 Jan, 2011

1 commit

  • * 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    MAINTAINERS: Update timer related entries
    timers: Use this_cpu_read
    timerqueue: Make timerqueue_getnext() static inline
    hrtimer: fix timerqueue conversion flub
    hrtimers: Convert hrtimers to use timerlist infrastructure
    timers: Fixup allmodconfig build issue
    timers: Rename timerlist infrastructure to timerqueue
    timers: Introduce timerlist infrastructure.
    hrtimer: Remove stale comment on curr_timer
    timer: Warn when del_timer_sync() is called in hardirq context
    timer: Del_timer_sync() can be used in softirq context
    timer: Make try_to_del_timer_sync() the same on SMP and UP
    posix-timers: Annotate lock_timer()
    timer: Permit statically-declared work with deferrable timers
    time: Use ARRAY_SIZE macro in timecompare.c
    timer: Initialize the field slack of timer_list
    timer_list: Remove alignment padding on 64 bit when CONFIG_TIMER_STATS
    time: Compensate for rounding on odd-frequency clocksources

    Fix up trivial conflict in MAINTAINERS

    Linus Torvalds
     

23 Dec, 2010

1 commit


17 Dec, 2010

1 commit

  • __get_cpu_var() can be replaced with this_cpu_read and will then use a
    single read instruction with implied address calculation to access the
    correct per cpu instance.

    However, the address of a per cpu variable passed to __this_cpu_read()
    cannot be determined (since it's an implied address conversion through
    segment prefixes). Therefore apply this only to uses of __get_cpu_var
    where the address of the variable is not used.

    Cc: Pekka Enberg
    Cc: Hugh Dickins
    Cc: Thomas Gleixner
    Acked-by: H. Peter Anvin
    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo

    Christoph Lameter
     

11 Dec, 2010

2 commits

  • In converting the hrtimers to timerqueue, I missed
    a spot in hrtimer_run_queues where we loop running
    timers. We end up not pulling the new next value out
    and instead just use the last next value, causing
    boot time hangs in some cases.

    The proper fix is to pull timerqueue_getnext each iteration
    instead of using a local next value.

    Reported-by: Ingo Molnar
    Signed-off-by: John Stultz

    John Stultz
     
  • Converts the hrtimer code to use the new timerlist infrastructure

    Signed-off-by: John Stultz
    LKML Reference:
    Reviewed-by: Thomas Gleixner
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: Richard Cochran

    John Stultz
     

14 Oct, 2010

1 commit

  • The race is described as follows:

    CPU X CPU Y
    remove_hrtimer
    // state & QUEUED == 0
    timer->state = CALLBACK
    unlock timer base
    timer->f(n) //very long
    hrtimer_start
    lock timer base
    remove_hrtimer // no effect
    hrtimer_enqueue
    timer->state = CALLBACK |
    QUEUED
    unlock timer base
    hrtimer_start
    lock timer base
    remove_hrtimer
    mode = INACTIVE
    // CALLBACK bit lost!
    switch_hrtimer_base
    CALLBACK bit not set:
    timer->base
    changes to a
    different CPU.
    lock this CPU's timer base

    The bug was introduced with commit ca109491f (hrtimer: removing all ur
    callback modes) in 2.6.29

    [ tglx: Feed new state via local variable and add a comment. ]

    Signed-off-by: Salman Qazi
    Cc: akpm@linux-foundation.org
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Thomas Gleixner
    Cc: stable@kernel.org

    Salman Qazi
     

05 Sep, 2010

1 commit


07 Aug, 2010

1 commit

  • …x/kernel/git/tip/linux-2.6-tip

    * 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Fix read_persistent_clock fallout
    kgdb: Do not access xtime directly
    powerpc: Clean up obsolete code relating to decrementer and timebase
    powerpc: Rework VDSO gettimeofday to prevent time going backwards
    clocksource: Add __clocksource_updatefreq_hz/khz methods
    x86: Convert common clocksources to use clocksource_register_hz/khz
    timekeeping: Make xtime and wall_to_monotonic static
    hrtimer: Cleanup direct access to wall_to_monotonic
    um: Convert to use read_persistent_clock
    timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
    powerpc: Cleanup xtime usage
    powerpc: Simplify update_vsyscall
    time: Kill off CONFIG_GENERIC_TIME
    time: Implement timespec_add
    x86: Fix vtime/file timestamp inconsistencies

    Trivial conflicts in Documentation/feature-removal-schedule.txt

    Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
    per Thomas' earlier merge commit 47916be4e28c ("Merge branch
    'powerpc.cherry-picks' into timers/clocksource")

    Linus Torvalds
     

27 Jul, 2010

1 commit


09 Jun, 2010

1 commit

  • In the new push model, all idle CPUs indeed go into nohz mode. There is
    still the concept of idle load balancer (performing the load balancing
    on behalf of all the idle cpu's in the system). Busy CPU kicks the nohz
    balancer when any of the nohz CPUs need idle load balancing.
    The kickee CPU does the idle load balancing on behalf of all idle CPUs
    instead of the normal idle balance.

    This addresses the below two problems with the current nohz ilb logic:
    * the idle load balancer continued to have periodic ticks during idle and
    wokeup frequently, even though it did not have any rebalancing to do on
    behalf of any of the idle CPUs.
    * On x86 and CPUs that have APIC timer stoppage on idle CPUs, this
    periodic wakeup can result in a periodic additional interrupt on a CPU
    doing the timer broadcast.

    Also currently we are migrating the unpinned timers from an idle to the cpu
    doing idle load balancing (when all the cpus in the system are idle,
    there is no idle load balancing cpu and timers get added to the same idle cpu
    where the request was made. So the existing optimization works only on semi idle
    system).

    And In semi idle system, we no longer have periodic ticks on the idle load
    balancer CPU. Using that cpu will add more delays to the timers than intended
    (as that cpu's timer base may not be uptodate wrt jiffies etc). This was
    causing mysterious slowdowns during boot etc.

    For now, in the semi idle case, use the nearest busy cpu for migrating timers
    from an idle cpu. This is good for power-savings anyway.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Suresh Siddha
    Signed-off-by: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Venkatesh Pallipadi
     

26 May, 2010

1 commit

  • hrtimer_get_softirq_time() has it's own xtime lock protection, so it's
    safe to use plain __current_kernel_time() and avoid the double seqlock
    loop.

    Signed-off-by: Stanislaw Gruszka
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Stanislaw Gruszka
     

07 Apr, 2010

1 commit

  • The current version of schedule_hrtimeout() always uses the
    monotonic clock. Some system calls such as mq_timedsend()
    and mq_timedreceive(), however, require the use of the wall
    clock due to the definition of the system call.

    This patch provides the infrastructure to use schedule_hrtimeout()
    with a CLOCK_REALTIME timer.

    Signed-off-by: Carsten Emde
    Tested-by: Pradyumna Sampath
    Cc: Andrew Morton
    Cc: Arjan van de Veen
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Carsten Emde
     

15 Dec, 2009

1 commit


10 Dec, 2009

2 commits

  • There is no reason to make timer_stats_hrtimer_set_start_info and
    friends visible to the rest of the kernel. So move all of them to
    hrtimer.c. Also make timer_stats_hrtimer_set_start_info a static
    inline function so it gets inlined and we avoid another function call.
    Based on a patch by Thomas Gleixner.

    Signed-off-by: Heiko Carstens
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Heiko Carstens
     
  • The hrtimer_interrupt hang logic adjusts min_delta_ns based on the
    execution time of the hrtimer callbacks.

    This is error-prone for virtual machines, where a guest vcpu can be
    scheduled out during the execution of the callbacks (and the callbacks
    themselves can do operations that translate to blocking operations in
    the hypervisor), which in can lead to large min_delta_ns rendering the
    system unusable.

    Replace the current heuristics with something more reliable. Allow the
    interrupt code to try 3 times to catch up with the lost time. If that
    fails use the total time spent in the interrupt handler to defer the
    next timer interrupt so the system can catch up with other things
    which got delayed. Limit that deferment to 100ms.

    The retry events and the maximum time spent in the interrupt handler
    are recorded and exposed via /proc/timer_list

    Inspired by a patch from Marcelo.

    Reported-by: Michael Tokarev
    Signed-off-by: Thomas Gleixner
    Tested-by: Marcelo Tosatti
    Cc: kvm@vger.kernel.org

    Thomas Gleixner
     

09 Dec, 2009

1 commit

  • * 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    timers, init: Limit the number of per cpu calibration bootup messages
    posix-cpu-timers: optimize and document timer_create callback
    clockevents: Add missing include to pacify sparse
    x86: vmiclock: Fix printk format
    x86: Fix printk format due to variable type change
    sparc: fix printk for change of variable type
    clocksource/events: Fix fallout of generic code changes
    nohz: Allow 32-bit machines to sleep for more than 2.15 seconds
    nohz: Track last do_timer() cpu
    nohz: Prevent clocksource wrapping during idle
    nohz: Type cast printk argument
    mips: Use generic mult/shift factor calculation for clocks
    clocksource: Provide a generic mult/shift factor calculation
    clockevents: Use u32 for mult and shift factors
    nohz: Introduce arch_needs_cpu
    nohz: Reuse ktime in sub-functions of tick_check_idle.
    time: Remove xtime_cache
    time: Implement logarithmic time accumulation

    Linus Torvalds
     

14 Nov, 2009

1 commit

  • In the dynamic tick code, "max_delta_ns" (member of the
    "clock_event_device" structure) represents the maximum sleep time
    that can occur between timer events in nanoseconds.

    The variable, "max_delta_ns", is defined as an unsigned long
    which is a 32-bit integer for 32-bit machines and a 64-bit
    integer for 64-bit machines (if -m64 option is used for gcc).
    The value of max_delta_ns is set by calling the function
    "clockevent_delta2ns()" which returns a maximum value of LONG_MAX.
    For a 32-bit machine LONG_MAX is equal to 0x7fffffff and in
    nanoseconds this equates to ~2.15 seconds. Hence, the maximum
    sleep time for a 32-bit machine is ~2.15 seconds, where as for
    a 64-bit machine it will be many years.

    This patch changes the type of max_delta_ns to be "u64" instead of
    "unsigned long" so that this variable is a 64-bit type for both 32-bit
    and 64-bit machines. It also changes the maximum value returned by
    clockevent_delta2ns() to KTIME_MAX. Hence this allows a 32-bit
    machine to sleep for longer than ~2.15 seconds. Please note that this
    patch also changes "min_delta_ns" to be "u64" too and although this is
    unnecessary, it makes the patch simpler as it avoids to fixup all
    callers of clockevent_delta2ns().

    [ tglx: changed "unsigned long long" to u64 as we use this data type
    through out the time code ]

    Signed-off-by: Jon Hunter
    Cc: John Stultz
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Jon Hunter
     

06 Oct, 2009

1 commit


28 Sep, 2009

1 commit