08 Oct, 2016

1 commit

  • Though the time_before and time_after family of functions were nicely
    extended to support jiffies64, so that the interface would be consistent,
    it was forgotten to also extend the before/after jiffies functions to
    support jiffies64. This commit brings the interface to parity between
    jiffies and jiffies64, which is quite convenient.

    Link: http://lkml.kernel.org/r/20160929033319.12188-1-Jason@zx2c4.com
    Signed-off-by: Jason A. Donenfeld
    Cc: Thomas Gleixner
    Cc: John Stultz
    Signed-off-by: Linus Torvalds

    Jason A. Donenfeld
     

02 Sep, 2015

1 commit

  • Pull timer updates from Thomas Gleixner:
    "Rather large, but nothing exiting:

    - new range check for settimeofday() to prevent that boot time
    becomes negative.
    - fix for file time rounding
    - a few simplifications of the hrtimer code
    - fix for the proc/timerlist code so the output of clock realtime
    timers is accurate
    - more y2038 work
    - tree wide conversion of clockevent drivers to the new callbacks"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (88 commits)
    hrtimer: Handle failure of tick_init_highres() gracefully
    hrtimer: Unconfuse switch_hrtimer_base() a bit
    hrtimer: Simplify get_target_base() by returning current base
    hrtimer: Drop return code of hrtimer_switch_to_hres()
    time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64()
    time: Introduce current_kernel_time64()
    time: Introduce struct itimerspec64
    time: Add the common weak version of update_persistent_clock()
    time: Always make sure wall_to_monotonic isn't positive
    time: Fix nanosecond file time rounding in timespec_trunc()
    timer_list: Add the base offset so remaining nsecs are accurate for non monotonic timers
    cris/time: Migrate to new 'set-state' interface
    kernel: broadcast-hrtimer: Migrate to new 'set-state' interface
    xtensa/time: Migrate to new 'set-state' interface
    unicore/time: Migrate to new 'set-state' interface
    um/time: Migrate to new 'set-state' interface
    sparc/time: Migrate to new 'set-state' interface
    sh/localtimer: Migrate to new 'set-state' interface
    score/time: Migrate to new 'set-state' interface
    s390/time: Migrate to new 'set-state' interface
    ...

    Linus Torvalds
     

01 Sep, 2015

1 commit

  • Pull NOHZ updates from Ingo Molnar:
    "The main changes, mostly written by Frederic Weisbecker, include:

    - Fix some jiffies based cputime assumptions. (No real harm because
    the concerned code isn't used by full dynticks.)

    - Simplify jiffies usecs conversions. Remove dead code.

    - Remove early hacks on nohz full code that avoided messing up idle
    nohz internals. Now nohz integrates well full and idle and such
    hack have become needless.

    - Restart nohz full tick from irq exit. (A simplification and a
    preparation for future optimization on scheduler kick to nohz
    full)

    - Code cleanups.

    - Tile driver isolation enhancement on top of nohz. (Chris Metcalf)"

    * 'timers-nohz-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    nohz: Remove useless argument on tick_nohz_task_switch()
    nohz: Move tick_nohz_restart_sched_tick() above its users
    nohz: Restart nohz full tick from irq exit
    nohz: Remove idle task special case
    nohz: Prevent tilegx network driver interrupts
    alpha: Fix jiffies based cputime assumption
    apm32: Fix cputime == jiffies assumption
    jiffies: Remove HZ > USEC_PER_SEC special case

    Linus Torvalds
     

18 Aug, 2015

1 commit

  • The conversion between struct timespec and jiffies is not year 2038
    safe on 32bit systems. Introduce timespec64_to_jiffies() and
    jiffies_to_timespec64() functions which use struct timespec64 to
    make it ready for 2038 issue.

    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Baolin Wang
    Signed-off-by: John Stultz

    Baolin Wang
     

05 Aug, 2015

1 commit

  • With this config:

    http://busybox.net/~vda/kernel_config_OPTIMIZE_INLINING_and_Os

    gcc-4.7.2 generates many copies of these tiny functions:

    msecs_to_jiffies (45 copies):
    55 push %rbp
    48 89 e5 mov %rsp,%rbp
    e8 59 ec 03 00 callq __msecs_to_jiffies
    5d pop %rbp
    c3 retq

    usecs_to_jiffies (10 copies):
    55 push %rbp
    48 89 e5 mov %rsp,%rbp
    e8 5d 54 5e ff callq __usecs_to_jiffies
    5d pop %rbp
    c3 retq

    See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122

    This patch fixes this via s/inline/__always_inline/

    text data bss dec filename
    86970954 17195912 36659200 140826066 vmlinux.before
    86966150 17195912 36659200 140821262 vmlinux

    Signed-off-by: Denys Vlasenko
    Cc: Andrew Morton
    Cc: David Rientjes
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Thomas Graf
    Cc: linux-kernel@vger.kernel.org
    Link: http://lkml.kernel.org/r/1438697716-28121-3-git-send-email-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     

29 Jul, 2015

1 commit

  • HZ never goes much further 1000 and a bit. And if we ever reach one tick
    per microsecond, we might be having a problem.

    Lets stop maintaining this special case, just leave a paranoid check.

    Reviewed-by: Rik van Riel
    Cc: Christoph Lameter
    Cc: Ingo Molnar
    Cc; John Stultz
    Cc: Peter Zijlstra
    Cc: Preeti U Murthy
    Cc: Rik van Riel
    Cc: Thomas Gleixner
    Cc: Viresh Kumar
    Signed-off-by: Frederic Weisbecker

    Frederic Weisbecker
     

10 Jun, 2015

2 commits

  • To allow constant folding in usecs_to_jiffies() conditionally calls
    the HZ dependent _usecs_to_jiffies() helpers or, when gcc can not
    figure out constant folding, __usecs_to_jiffies, which is the renamed
    original usecs_to_jiffies() function.

    Signed-off-by: Nicholas Mc Guire
    Cc: Masahiro Yamada
    Cc: Sam Ravnborg
    Cc: Joe Perches
    Cc: John Stultz
    Cc: Andrew Hunter
    Cc: Paul Turner
    Cc: Michal Marek
    Link: http://lkml.kernel.org/r/1432832996-12129-2-git-send-email-hofrat@osadl.org
    Signed-off-by: Thomas Gleixner

    Nicholas Mc Guire
     
  • Refactor the usecs_to_jiffies conditional code part in time.c and
    jiffies.h putting it into conditional functions rather than #ifdefs
    to improve readability. This is analogous to the msecs_to_jiffies()
    cleanup in commit ca42aaf0c861 ("time: Refactor msecs_to_jiffies")

    Signed-off-by: Nicholas Mc Guire
    Cc: Masahiro Yamada
    Cc: Sam Ravnborg
    Cc: Joe Perches
    Cc: John Stultz
    Cc: Andrew Hunter
    Cc: Paul Turner
    Cc: Michal Marek
    Link: http://lkml.kernel.org/r/1432832996-12129-1-git-send-email-hofrat@osadl.org
    Signed-off-by: Thomas Gleixner

    Nicholas Mc Guire
     

19 May, 2015

3 commits

  • Somehow I missed to clean that up when applying the patches. Fix it up
    now.

    Reported-by: Joe Perches
    Signed-off-by: Thomas Gleixner
    Cc: Nicholas Mc Guire

    Thomas Gleixner
     
  • To allow constant folding in msecs_to_jiffies() conditionally calls
    the HZ dependent _msecs_to_jiffies() helpers or, when gcc can not
    figure out constant folding, __msecs_to_jiffies which is the renamed
    original msecs_to_jiffies() function.

    Signed-off-by: Nicholas Mc Guire
    Cc: Masahiro Yamada
    Cc: Sam Ravnborg
    Cc: Joe Perches
    Cc: John Stultz
    Cc: Andrew Hunter
    Cc: Paul Turner
    Cc: Michal Marek
    Link: http://lkml.kernel.org/r/1431951554-5563-3-git-send-email-hofrat@osadl.org
    Signed-off-by: Thomas Gleixner

    Nicholas Mc Guire
     
  • Refactor the msecs_to_jiffies conditional code part in time.c and
    jiffies.h putting it into conditional functions rather than #ifdefs
    to improve readability.

    [ tglx: Verified that there is no binary code change ]

    Signed-off-by: Nicholas Mc Guire
    Cc: Masahiro Yamada
    Cc: Sam Ravnborg
    Cc: Joe Perches
    Cc: John Stultz
    Cc: Andrew Hunter
    Cc: Paul Turner
    Cc: Michal Marek
    Link: http://lkml.kernel.org/r/1431951554-5563-2-git-send-email-hofrat@osadl.org
    Signed-off-by: Thomas Gleixner

    Nicholas Mc Guire
     

13 Sep, 2014

1 commit

  • timeval_to_jiffies tried to round a timeval up to an integral number
    of jiffies, but the logic for doing so was incorrect: intervals
    corresponding to exactly N jiffies would become N+1. This manifested
    itself particularly repeatedly stopping/starting an itimer:

    setitimer(ITIMER_PROF, &val, NULL);
    setitimer(ITIMER_PROF, NULL, &val);

    would add a full tick to val, _even if it was exactly representable in
    terms of jiffies_ (say, the result of a previous rounding.) Doing
    this repeatedly would cause unbounded growth in val. So fix the math.

    Here's what was wrong with the conversion: we essentially computed
    (eliding seconds)

    jiffies = usec * (NSEC_PER_USEC/TICK_NSEC)

    by using scaling arithmetic, which took the best approximation of
    NSEC_PER_USEC/TICK_NSEC with denominator of 2^USEC_JIFFIE_SC =
    x/(2^USEC_JIFFIE_SC), and computed:

    jiffies = (usec * x) >> USEC_JIFFIE_SC

    and rounded this calculation up in the intermediate form (since we
    can't necessarily exactly represent TICK_NSEC in usec.) But the
    scaling arithmetic is a (very slight) *over*approximation of the true
    value; that is, instead of dividing by (1 usec/ 1 jiffie), we
    effectively divided by (1 usec/1 jiffie)-epsilon (rounding
    down). This would normally be fine, but we want to round timeouts up,
    and we did so by adding 2^USEC_JIFFIE_SC - 1 before the shift; this
    would be fine if our division was exact, but dividing this by the
    slightly smaller factor was equivalent to adding just _over_ 1 to the
    final result (instead of just _under_ 1, as desired.)

    In particular, with HZ=1000, we consistently computed that 10000 usec
    was 11 jiffies; the same was true for any exact multiple of
    TICK_NSEC.

    We could possibly still round in the intermediate form, adding
    something less than 2^USEC_JIFFIE_SC - 1, but easier still is to
    convert usec->nsec, round in nanoseconds, and then convert using
    time*spec*_to_jiffies. This adds one constant multiplication, and is
    not observably slower in microbenchmarks on recent x86 hardware.

    Tested: the following program:

    int main() {
    struct itimerval zero = {{0, 0}, {0, 0}};
    /* Initially set to 10 ms. */
    struct itimerval initial = zero;
    initial.it_interval.tv_usec = 10000;
    setitimer(ITIMER_PROF, &initial, NULL);
    /* Save and restore several times. */
    for (size_t i = 0; i < 10; ++i) {
    struct itimerval prev;
    setitimer(ITIMER_PROF, &zero, &prev);
    /* on old kernels, this goes up by TICK_USEC every iteration */
    printf("previous value: %ld %ld %ld %ld\n",
    prev.it_interval.tv_sec, prev.it_interval.tv_usec,
    prev.it_value.tv_sec, prev.it_value.tv_usec);
    setitimer(ITIMER_PROF, &prev, NULL);
    }
    return 0;
    }

    Cc: stable@vger.kernel.org
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Paul Turner
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Reviewed-by: Paul Turner
    Reported-by: Aaron Jacobs
    Signed-off-by: Andrew Hunter
    [jstultz: Tweaked to apply to 3.17-rc]
    Signed-off-by: John Stultz

    Andrew Hunter
     

16 Jan, 2014

1 commit

  • While calculating the scheduler tick max deferment, the delta is
    converted from microseconds to nanoseconds through a multiplication
    against NSEC_PER_USEC.

    But this microseconds operand is an unsigned int, thus the result may
    likely overflow. The result is cast to u64 but only once the operation
    is completed, which is too late to avoid overflown result.

    This is currently not a problem because the scheduler tick max deferment
    is 1 second. But this may become an issue as we plan to make this
    value tunable.

    So lets fix this by casting the usecs value to u64 before multiplying by
    NSECS_PER_USEC.

    Also to prevent from this kind of mistake to happen again, move this
    ad-hoc jiffies -> nsecs conversion to a new helper.

    Signed-off-by: Kevin Hilman
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Alex Shi
    Cc: Steven Rostedt
    Cc: Paul E. McKenney
    Cc: John Stultz
    Cc: Kevin Hilman
    Link: http://lkml.kernel.org/r/1387315388-31676-2-git-send-email-khilman@linaro.org
    [move ad-hoc conversion to jiffies_to_nsecs helper]
    Signed-off-by: Frederic Weisbecker

    Kevin Hilman
     

21 Aug, 2013

1 commit

  • According to the C standard 3.4.3p3, overflow of a signed integer results
    in undefined behavior. This commit therefore changes the definitions
    of time_after(), time_after_eq(), time_after64(), and time_after_eq64()
    to avoid this undefined behavior. The trick is that the subtraction
    is done using unsigned arithmetic, which according to 6.2.5p9 cannot
    overflow because it is defined as modulo arithmetic. This has the added
    (though admittedly quite small) benefit of shortening four lines of code
    by four characters each.

    Note that the C standard considers the cast from unsigned to
    signed to be implementation-defined, see 6.3.1.3p3. However, on a
    two's-complement system, an implementation that defines anything other
    than a reinterpretation of the bits is free to come to me, and I will be
    happy to act as a witness for its being committed to an insane asylum.
    (Although I have nothing against saturating arithmetic or signals in some
    cases, these things really should not be the default when compiling an
    operating-system kernel.)

    Signed-off-by: Paul E. McKenney
    Cc: John Stultz
    Cc: "David S. Miller"
    Cc: Arnd Bergmann
    Cc: Ingo Molnar
    Cc: Linus Torvalds
    Cc: Eric Dumazet
    Cc: Kevin Easton
    [ paulmck: Included time_after64() and time_after_eq64(), as suggested
    by Eric Dumazet, also fixed commit message.]
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

03 Jul, 2013

1 commit

  • Time in range will fail safely if we move to a different cpu with an
    extremely large clock skew.
    Add time_in_range64() and convert lls to use it.

    changelog:
    v2
    - fixed double call to sched_clock in can_poll_ll
    - fixed checkpatchisms

    Signed-off-by: Eliezer Tamir
    Signed-off-by: David S. Miller

    Eliezer Tamir
     

23 Mar, 2013

1 commit


14 Nov, 2012

1 commit


12 Oct, 2012

1 commit

  • Pull timer core update from Thomas Gleixner:
    - Bug fixes (one for a longstanding dead loop issue)
    - Rework of time related vsyscalls
    - Alarm timer updates
    - Jiffies updates to remove compile time dependencies

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    timekeeping: Cast raw_interval to u64 to avoid shift overflow
    timers: Fix endless looping between cascade() and internal_add_timer()
    time/jiffies: bring back unconditional LATCH definition
    time: Convert x86_64 to using new update_vsyscall
    time: Only do nanosecond rounding on GENERIC_TIME_VSYSCALL_OLD systems
    time: Introduce new GENERIC_TIME_VSYSCALL
    time: Convert CONFIG_GENERIC_TIME_VSYSCALL to CONFIG_GENERIC_TIME_VSYSCALL_OLD
    time: Move update_vsyscall definitions to timekeeper_internal.h
    time: Move timekeeper structure to timekeeper_internal.h for vsyscall changes
    jiffies: Remove compile time assumptions about CLOCK_TICK_RATE
    jiffies: Kill unused TICK_USEC_TO_NSEC
    alarmtimer: Rename alarmtimer_remove to alarmtimer_dequeue
    alarmtimer: Remove unused helpers & defines
    alarmtimer: Use hrtimer per-alarm instead of per-base
    alarmtimer: Implement minimum alarm interval for allowing suspend

    Linus Torvalds
     

29 Sep, 2012

2 commits

  • Sort out conflict with Arnd's patch that preserves
    the unconditional LATCH value.

    Signed-off-by: John Stultz

    John Stultz
     
  • Patch a7ea3bbf5d "time/jiffies: Allow CLOCK_TICK_RATE to be undefined"
    breaks the compilation of targets that rely on the LATCH definition,
    because of recursive header file inclusion not defining CLOCK_TICK_RATE
    before it is checked here.

    This fixes the problem by moving LATCH back to where it was, but it
    seems that there are still cases where SHIFTED_HZ is defined incorrectly
    because of the same problem. Need to investigate further.

    Without this patch, building h7201_defconfig results in:

    arch/arm/mach-h720x/common.c: In function 'h720x_gettimeoffset':
    arch/arm/mach-h720x/common.c:50:73: error: 'LATCH' undeclared (first use in this function)
    arch/arm/mach-h720x/common.c:50:73: note: each undeclared identifier is reported only once for each function it appears in
    arch/arm/mach-h720x/common.c:51:1: warning: control reaches end of non-void function [-Wreturn-type]

    Signed-off-by: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Andrew Morton
    Cc: John Stultz
    Cc: Ingo Molnar
    Signed-off-by: John Stultz

    Arnd Bergmann
     

25 Sep, 2012

2 commits

  • CLOCK_TICK_RATE is used to accurately caclulate exactly how
    a tick will be at a given HZ.

    This is useful, because while we'd expect NSEC_PER_SEC/HZ,
    the underlying hardware will have some granularity limit,
    so we won't be able to have exactly HZ ticks per second.

    This slight error can cause timekeeping quality problems
    when using the jiffies or other jiffies driven clocksources.
    Thus we currently use compile time CLOCK_TICK_RATE value to
    generate SHIFTED_HZ and NSEC_PER_JIFFIES, which we then use
    to adjust the jiffies clocksource to correct this error.

    Unfortunately though, since CLOCK_TICK_RATE is a compile
    time value, and the jiffies clocksource is registered very
    early during boot, there are a number of cases where there
    are different possible hardware timers that have different
    tick rates. This causes problems in cases like ARM where
    there are numerous different types of hardware, each having
    their own compile-time CLOCK_TICK_RATE, making it hard to
    accurately support different hardware with a single kernel.

    For the most part, this doesn't matter all that much, as not
    too many systems actually utilize the jiffies or jiffies driven
    clocksource. Usually there are other highres clocksources
    who's granularity error is negligable.

    Even so, we have some complicated calcualtions that we do
    everywhere to handle these edge cases.

    This patch removes the compile time SHIFTED_HZ value, and
    introduces a register_refined_jiffies() function. This results
    in the default jiffies clock as being assumed a perfect HZ
    freq, and allows archtectures that care about jiffies accuracy
    to call register_refined_jiffies() with the tick rate, specified
    dynamically at boot.

    This allows us, where necessary, to not have a compile time
    CLOCK_TICK_RATE constant, simplifies the jiffies code, and
    still provides a way to have an accurate jiffies clock.

    NOTE: Since this patch does not add register_refinied_jiffies()
    calls for every arch, it may cause time quality regressions
    in some cases. Its likely these will not be noticable, but
    if they are an issue, adding the following to the end of
    setup_arch() should resolve the regression:
    register_refinied_jiffies(CLOCK_TICK_RATE)

    Cc: Catalin Marinas
    Cc: Arnd Bergmann
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Thomas Gleixner
    Signed-off-by: John Stultz

    John Stultz
     
  • No one is using TICK_USEC_TO_NSEC, so kill it.

    Cc: Catalin Marinas
    Cc: Arnd Bergmann
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Thomas Gleixner
    Signed-off-by: John Stultz

    John Stultz
     

23 Aug, 2012

1 commit


10 Aug, 2012

1 commit

  • Various /proc/net files sometimes report crazy timer values, expressed
    in clock_t units.

    This happens when an expired timer delta (expires - jiffies) is passed
    to jiffies_to_clock_t().

    This function has an overflow in :

    return div_u64((u64)x * TICK_NSEC, NSEC_PER_SEC / USER_HZ);

    commit cbbc719fccdb8cb (time: Change jiffies_to_clock_t() argument type
    to unsigned long) only got around the problem.

    As we cant output negative values in /proc/net/tcp without breaking
    various tools, I suggest adding a jiffies_delta_to_clock_t() wrapper
    that caps the negative delta to a 0 value.

    Signed-off-by: Eric Dumazet
    Reported-by: Maciej Żenczykowski
    Cc: Thomas Gleixner
    Cc: Paul Gortmaker
    Cc: Andrew Morton
    Cc: hank
    Signed-off-by: David S. Miller

    Eric Dumazet
     

31 Jul, 2012

2 commits

  • Ingo noted that ACTHZ is a confusing name, and requested it
    be renamed, so this patch renames ACTHZ to SHIFTED_HZ to
    better describe it.

    Signed-off-by: John Stultz
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1343414893-45779-3-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    John Stultz
     
  • CLOCK_TICK_RATE is a legacy constant that defines the timer
    device's granularity. On hardware with particularly coarse
    granularity, this constant is used to reduce accumulated
    time error when using jiffies as a clocksource, by calculating
    the hardware's actual tick length rather then just assuming
    it is 1sec/HZ.

    However, for the most part this is unnecessary, as most modern
    systems don't use jiffies for their clocksource, and their
    tick device is sufficiently fine grained to avoid major error.

    Thus, this patch allows an architecture to not define
    CLOCK_TICK_RATE, in which case ACTHZ defaults to (HZ << 8).

    Signed-off-by: Catalin Marinas
    Acked-by: Arnd Bergmann
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Andrew Morton
    [ Commit log & intention tweaks ]
    Signed-off-by: John Stultz
    Link: http://lkml.kernel.org/r/1343414893-45779-2-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Catalin Marinas
     

21 Sep, 2011

1 commit

  • The parameter's origin type is long. On an i386 architecture, it can
    easily be larger than 0x80000000, causing this function to convert it
    to a sign-extended u64 type.

    Change the type to unsigned long so we get the correct result.

    Signed-off-by: hank
    Cc: John Stultz
    Cc:
    [ build fix ]
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    hank
     

31 Mar, 2011

1 commit


26 Jan, 2011

1 commit


26 Nov, 2009

1 commit

  • Use of msecs_to_jiffies() for nsecs_to_cputime() have some
    problems:

    - The type of msecs_to_jiffies()'s argument is unsigned int, so
    it cannot convert msecs greater than UINT_MAX = about 49.7 days.

    - msecs_to_jiffies() returns MAX_JIFFY_OFFSET if MSB of argument
    is set, assuming that input was negative value. So it cannot
    convert msecs greater than INT_MAX = about 24.8 days too.

    This patch defines a new function nsecs_to_jiffies() that can
    deal greater values, and that can deal all incoming values as
    unsigned.

    Signed-off-by: Hidetoshi Seto
    Acked-by: Peter Zijlstra
    Cc: Stanislaw Gruszka
    Cc: Spencer Candland
    Cc: Oleg Nesterov
    Cc: Balbir Singh
    Cc: Amrico Wang
    Cc: Thomas Gleixner
    Cc: John Stultz
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hidetoshi Seto
     

24 Dec, 2008

1 commit

  • Hi.

    I've been looking at a bugzilla which describes a problem where
    a customer was advised to use either the "noac" or "actimeo=0"
    mount options to solve a consistency problem that they were
    seeing in the file attributes. It turned out that this solution
    did not work reliably for them because sometimes, the local
    attribute cache was believed to be valid and not timed out.
    (With an attribute cache timeout of 0, the cache should always
    appear to be timed out.)

    In looking at this situation, it appears to me that the problem
    is that the attribute cache timeout code has an off-by-one
    error in it. It is assuming that the cache is valid in the
    region, [read_cache_jiffies, read_cache_jiffies + attrtimeo]. The
    cache should be considered valid only in the region,
    [read_cache_jiffies, read_cache_jiffies + attrtimeo). With this
    change, the options, "noac" and "actimeo=0", work as originally
    expected.

    This problem was previously addressed by special casing the
    attrtimeo == 0 case. However, since the problem is only an off-
    by-one error, the cleaner solution is address the off-by-one
    error and thus, not require the special case.

    Thanx...

    ps

    Signed-off-by: Peter Staubach
    Signed-off-by: Trond Myklebust

    Peter Staubach
     

01 May, 2008

1 commit

  • x86 is the only arch right now, which provides an optimized for
    div_long_long_rem and it has the downside that one has to be very careful that
    the divide doesn't overflow.

    The API is a little akward, as the arguments for the unsigned divide are
    signed. The signed version also doesn't handle a negative divisor and
    produces worse code on 64bit archs.

    There is little incentive to keep this API alive, so this converts the few
    users to the new API.

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

    Roman Zippel
     

22 Apr, 2008

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial: (24 commits)
    DOC: A couple corrections and clarifications in USB doc.
    Generate a slightly more informative error msg for bad HZ
    fix typo "is" -> "if" in Makefile
    ext*: spelling fix prefered -> preferred
    DOCUMENTATION: Use newer DEFINE_SPINLOCK macro in docs.
    KEYS: Fix the comment to match the file name in rxrpc-type.h.
    RAID: remove trailing space from printk line
    DMA engine: typo fixes
    Remove unused MAX_NODES_SHIFT
    MAINTAINERS: Clarify access to OCFS2 development mailing list.
    V4L: Storage class should be before const qualifier (sn9c102)
    V4L: Storage class should be before const qualifier
    sonypi: Storage class should be before const qualifier
    intel_menlow: Storage class should be before const qualifier
    DVB: Storage class should be before const qualifier
    arm: Storage class should be before const qualifier
    ALSA: Storage class should be before const qualifier
    acpi: Storage class should be before const qualifier
    firmware_sample_driver.c: fix coding style
    MAINTAINERS: Add ati_remote2 driver
    ...

    Fixed up trivial conflicts in firmware_sample_driver.c

    Linus Torvalds
     
  • Generate a slightly more informative error msg for bad HZ
    in include/linux/jiffies.h

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Jesper Juhl

    Robert P. J. Day
     

21 Apr, 2008

1 commit


09 Feb, 2008

1 commit

  • Fix typo in comments.

    BTW: I have to fix coding style in arch/ia64/kernel/time.c also, otherwise
    checkpatch.pl will be complaining.

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

    Li Zefan
     

26 Jan, 2008

1 commit


17 Oct, 2007

1 commit

  • Optionally add a boot delay after each kernel printk() call, crudely
    measured in milliseconds, with a maximum delay of 10 seconds per printk.

    Enable CONFIG_BOOT_PRINTK_DELAY=y and then add (e.g.):
    "lpj=loops_per_jiffy boot_delay=100"
    to the kernel command line.

    It has been useful in cases like "during boot, my machine just reboots or the
    screen goes black" by slowing down printk, (and adding initcall_debug), we can
    usually see the last thing that happened before the lights went out which is
    usually a valuable clue.

    [akpm@linux-foundation.org: not all architectures implement CONFIG_HZ]
    [akpm@linux-foundation.org: fix lots of stuff]
    [bunk@stusta.de: kernel/printk.c: make 2 variables static]
    [heiko.carstens@de.ibm.com: fix slow down printk on boot compile error]
    Signed-off-by: Randy Dunlap
    Signed-off-by: Dave Jones
    Signed-off-by: Adrian Bunk
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

16 Oct, 2007

1 commit

  • * git://git.linux-nfs.org/pub/linux/nfs-2.6: (131 commits)
    NFSv4: Fix a typo in nfs_inode_reclaim_delegation
    NFS: Add a boot parameter to disable 64 bit inode numbers
    NFS: nfs_refresh_inode should clear cache_validity flags on success
    NFS: Fix a connectathon regression in NFSv3 and NFSv4
    NFS: Use nfs_refresh_inode() in ops that aren't expected to change the inode
    SUNRPC: Don't call xprt_release in call refresh
    SUNRPC: Don't call xprt_release() if call_allocate fails
    SUNRPC: Fix buggy UDP transmission
    [23/37] Clean up duplicate includes in
    [2.6 patch] net/sunrpc/rpcb_clnt.c: make struct rpcb_program static
    SUNRPC: Use correct type in buffer length calculations
    SUNRPC: Fix default hostname created in rpc_create()
    nfs: add server port to rpc_pipe info file
    NFS: Get rid of some obsolete macros
    NFS: Simplify filehandle revalidation
    NFS: Ensure that nfs_link() returns a hashed dentry
    NFS: Be strict about dentry revalidation when doing exclusive create
    NFS: Don't zap the readdir caches upon error
    NFS: Remove the redundant nfs_reval_fsid()
    NFSv3: Always use directory post-op attributes in nfs3_proc_lookup
    ...

    Fix up trivial conflict due to sock_owned_by_user() cleanup manually in
    net/sunrpc/xprtsock.c

    Linus Torvalds
     

13 Oct, 2007

1 commit