1. 26 10月, 2015 1 次提交
  2. 16 10月, 2015 1 次提交
  3. 15 10月, 2015 4 次提交
  4. 12 10月, 2015 2 次提交
  5. 03 10月, 2015 1 次提交
  6. 02 10月, 2015 3 次提交
  7. 22 9月, 2015 2 次提交
  8. 14 9月, 2015 1 次提交
  9. 13 9月, 2015 1 次提交
    • J
      time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64() · 2619d7e9
      John Stultz 提交于
      The internal clocksteering done for fine-grained error
      correction uses a logarithmic approximation, so any time
      adjtimex() adjusts the clock steering, timekeeping_freqadjust()
      quickly approximates the correct clock frequency over a series
      of ticks.
      
      Unfortunately, the logic in timekeeping_freqadjust(), introduced
      in commit:
      
        dc491596 ("timekeeping: Rework frequency adjustments to work better w/ nohz")
      
      used the abs() function with a s64 error value to calculate the
      size of the approximated adjustment to be made.
      
      Per include/linux/kernel.h:
      
        "abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()".
      
      Thus on 32-bit platforms, this resulted in the clocksteering to
      take a quite dampended random walk trying to converge on the
      proper frequency, which caused the adjustments to be made much
      slower then intended (most easily observed when large
      adjustments are made).
      
      This patch fixes the issue by using abs64() instead.
      Reported-by: NNuno Gonçalves <nunojpg@gmail.com>
      Tested-by: NNuno Goncalves <nunojpg@gmail.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Cc: <stable@vger.kernel.org> # v3.17+
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Miroslav Lichvar <mlichvar@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1441840051-20244-1-git-send-email-john.stultz@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      2619d7e9
  10. 02 9月, 2015 1 次提交
  11. 22 8月, 2015 1 次提交
  12. 19 8月, 2015 2 次提交
  13. 18 8月, 2015 8 次提交
    • E
      timer: Write timer->flags atomically · d0023a14
      Eric Dumazet 提交于
      lock_timer_base() cannot prevent the following :
      
      CPU1 ( in __mod_timer()
      timer->flags |= TIMER_MIGRATING;
      spin_unlock(&base->lock);
      base = new_base;
      spin_lock(&base->lock);
      // The next line clears TIMER_MIGRATING
      timer->flags &= ~TIMER_BASEMASK;
                                        CPU2 (in lock_timer_base())
                                        see timer base is cpu0 base
                                        spin_lock_irqsave(&base->lock, *flags);
                                        if (timer->flags == tf)
                                             return base; // oops, wrong base
      timer->flags |= base->cpu // too late
      
      We must write timer->flags in one go, otherwise we can fool other cpus.
      
      Fixes: bc7a34b8 ("timer: Reduce timer migration overhead if disabled")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Jon Christopherson <jon@jons.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: xen-devel@lists.xen.org
      Cc: david.vrabel@citrix.com
      Cc: Sander Eikelenboom <linux@eikelenboom.it>
      Link: http://lkml.kernel.org/r/1439831928.32680.11.camel@edumazet-glaptop2.roam.corp.google.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      d0023a14
    • L
    • B
      time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64() · 9ca30850
      Baolin Wang 提交于
      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 <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NBaolin Wang <baolin.wang@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      9ca30850
    • B
      time: Introduce current_kernel_time64() · 8758a240
      Baolin Wang 提交于
      The current_kernel_time() is not year 2038 safe on 32bit systems
      since it returns a timespec value. Introduce current_kernel_time64()
      which returns a timespec64 value.
      
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NBaolin Wang <baolin.wang@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      8758a240
    • X
      time: Add the common weak version of update_persistent_clock() · 7494e9ee
      Xunlei Pang 提交于
      The weak update_persistent_clock64() calls update_persistent_clock(),
      if the architecture defines an update_persistent_clock64() to replace
      and remove its update_persistent_clock() version, when building the
      kernel the linker will throw an undefined symbol error, that is, any
      arch that switches to update_persistent_clock64() will have this issue.
      
      To solve the issue, we add the common weak update_persistent_clock().
      
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NXunlei Pang <pang.xunlei@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      7494e9ee
    • W
      time: Always make sure wall_to_monotonic isn't positive · e1d7ba87
      Wang YanQing 提交于
      Two issues were found on an IMX6 development board without an
      enabled RTC device(resulting in the boot time and monotonic
      time being initialized to 0).
      
      Issue 1:exportfs -a generate:
             "exportfs: /opt/nfs/arm does not support NFS export"
      Issue 2:cat /proc/stat:
             "btime 4294967236"
      
      The same issues can be reproduced on x86 after running the
      following code:
      	int main(void)
      	{
      	    struct timeval val;
      	    int ret;
      
      	    val.tv_sec = 0;
      	    val.tv_usec = 0;
      	    ret = settimeofday(&val, NULL);
      	    return 0;
      	}
      
      Two issues are different symptoms of same problem:
      The reason is a positive wall_to_monotonic pushes boot time back
      to the time before Epoch, and getboottime will return negative
      value.
      
      In symptom 1:
                negative boot time cause get_expiry() to overflow time_t
                when input expire time is 2147483647, then cache_flush()
                always clears entries just added in ip_map_parse.
      In symptom 2:
                show_stat() uses "unsigned long" to print negative btime
                value returned by getboottime.
      
      This patch fix the problem by prohibiting time from being set to a value which
      would cause a negative boot time. As a result one can't set the CLOCK_REALTIME
      time prior to (1970 + system uptime).
      
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      [jstultz: reworded commit message]
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      e1d7ba87
    • K
      time: Fix nanosecond file time rounding in timespec_trunc() · de4a95fa
      Karsten Blees 提交于
      timespec_trunc() avoids rounding if granularity <= nanoseconds-per-jiffie
      (or TICK_NSEC). This optimization assumes that:
      
       1. current_kernel_time().tv_nsec is already rounded to TICK_NSEC (i.e.
          with HZ=1000 you'd get 1000000, 2000000, 3000000... but never 1000001).
          This is no longer true (probably since hrtimers introduced in 2.6.16).
      
       2. TICK_NSEC is evenly divisible by all possible granularities. This may
          be true for HZ=100, 250, 1000, but obviously not for HZ=300 /
          TICK_NSEC=3333333 (introduced in 2.6.20).
      
      Thus, sub-second portions of in-core file times are not rounded to on-disk
      granularity. I.e. file times may change when the inode is re-read from disk
      or when the file system is remounted.
      
      This affects all file systems with file time granularities > 1 ns and < 1s,
      e.g. CEPH (1000 ns), UDF (1000 ns), CIFS (100 ns), NTFS (100 ns) and FUSE
      (configurable from user mode via struct fuse_init_out.time_gran).
      
      Steps to reproduce with e.g. UDF:
      
        $ dd if=/dev/zero of=udfdisk count=10000 && mkudffs udfdisk
        $ mkdir udf && mount udfdisk udf
        $ touch udf/test && stat -c %y udf/test
        2015-06-09 10:22:56.130006767 +0200
        $ umount udf && mount udfdisk udf
        $ stat -c %y udf/test
        2015-06-09 10:22:56.130006000 +0200
      
      Remounting truncates the mtime to 1 µs.
      
      Fix the rounding in timespec_trunc() and update the documentation.
      
      timespec_trunc() is exclusively used to calculate inode's [acm]time (mostly
      via current_fs_time()), and always with super_block.s_time_gran as second
      argument. So this can safely be changed without side effects.
      
      Note: This does _not_ fix the issue for FAT's 2 second mtime resolution,
      as super_block.s_time_gran isn't prepared to handle different ctime /
      mtime / atime resolutions nor resolutions > 1 second.
      
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NKarsten Blees <blees@dcon.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      de4a95fa
    • J
      timer_list: Add the base offset so remaining nsecs are accurate for non monotonic timers · 38bf985b
      John Stultz 提交于
      I noticed for non-monotonic timers in timer_list, some of the
      output looked a little confusing.
      
      For example:
       #1: <0000000000000000>, posix_timer_fn, S:01, hrtimer_start_range_ns, leap-a-day/2360
       # expires at 1434412800000000000-1434412800000000000 nsecs [in 1434410725062375469 to 1434410725062375469 nsecs]
      
      You'll note the relative time till the expiration "[in xxx to
      yyy nsecs]" is incorrect. This is because its printing the delta
      between CLOCK_MONOTONIC time to the CLOCK_REALTIME expiration.
      
      This patch fixes this issue by adding the clock offset to the
      "now" time which we use to calculate the delta.
      
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Jiri Bohac <jbohac@suse.cz>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      38bf985b
  14. 10 8月, 2015 1 次提交
  15. 01 8月, 2015 1 次提交
  16. 29 7月, 2015 5 次提交
    • F
      nohz: Remove useless argument on tick_nohz_task_switch() · de734f89
      Frederic Weisbecker 提交于
      Leftover from early code.
      
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      de734f89
    • F
      nohz: Move tick_nohz_restart_sched_tick() above its users · 59d2c7ca
      Frederic Weisbecker 提交于
      Fix the function declaration/definition dance.
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      59d2c7ca
    • F
      nohz: Restart nohz full tick from irq exit · 73738a95
      Frederic Weisbecker 提交于
      Restart the tick when necessary from the irq exit path. It makes nohz
      full more flexible, simplify the related IPIs and doesn't bring
      significant overhead on irq exit.
      
      In a longer term view, it will allow us to piggyback the nohz kick
      on the scheduler IPI in the future instead of sending a dedicated IPI
      that often doubles the scheduler IPI on task wakeup. This will require
      more changes though including careful review of resched_curr() callers
      to include nohz full needs.
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      73738a95
    • F
      nohz: Remove idle task special case · 59449359
      Frederic Weisbecker 提交于
      On nohz full early days, idle dynticks and full dynticks weren't well
      integrated and we couldn't risk full dynticks calls on idle without
      risking messing up tick idle statistics. This is why we prevented such
      thing to happen.
      
      Nowadays full dynticks and idle dynticks are better integrated and
      interact without known issue.
      
      So lets remove that.
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      59449359
    • F
      jiffies: Remove HZ > USEC_PER_SEC special case · e0758676
      Frederic Weisbecker 提交于
      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: NRik van Riel <riel@redhat.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc; John Stultz <john.stultz@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      e0758676
  17. 14 7月, 2015 1 次提交
  18. 11 7月, 2015 1 次提交
  19. 08 7月, 2015 3 次提交
    • T
      tick/broadcast: Handle spurious interrupts gracefully · c4288334
      Thomas Gleixner 提交于
      Andriy reported that on a virtual machine the warning about negative
      expiry time in the clock events programming code triggered:
      
      hpet: hpet0 irq 40 for MSI
      hpet: hpet1 irq 41 for MSI
      Switching to clocksource hpet
      WARNING: at kernel/time/clockevents.c:239
      
      [<ffffffff810ce6eb>] clockevents_program_event+0xdb/0xf0
      [<ffffffff810cf211>] tick_handle_periodic_broadcast+0x41/0x50
      [<ffffffff81016525>] timer_interrupt+0x15/0x20
      
      When the second hpet is installed as a per cpu timer the broadcast
      event is not longer required and stopped, which sets the next_evt of
      the broadcast device to KTIME_MAX.
      
      If after that a spurious interrupt happens on the broadcast device,
      then the current code blindly handles it and tries to reprogram the
      broadcast device afterwards, which adds the period to
      next_evt. KTIME_MAX + period results in a negative expiry value
      causing the WARN_ON in the clockevents code to trigger.
      
      Add a proper check for the state of the broadcast device into the
      interrupt handler and return if the interrupt is spurious.
      
      [ Folded in pointer fix from Sudeep ]
      Reported-by: NAndriy Gapon <avg@FreeBSD.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20150705205221.802094647@linutronix.de
      c4288334
    • T
      tick/broadcast: Check for hrtimer broadcast active early · d5113e13
      Thomas Gleixner 提交于
      If the current cpu is the one which has the hrtimer based broadcast
      queued then we better return busy immediately instead of going through
      loops and hoops to figure that out.
      
      [ Split out from a larger combo patch ]
      Tested-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Suzuki Poulose <Suzuki.Poulose@arm.com>
      Cc: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
      Cc: Catalin Marinas <Catalin.Marinas@arm.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
      d5113e13
    • T
      tick/broadcast: Return busy when IPI is pending · 0cc5281a
      Thomas Gleixner 提交于
      Tell the idle code not to go deep if the broadcast IPI is about to
      arrive.
      
      [ Split out from a larger combo patch ]
      Tested-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Suzuki Poulose <Suzuki.Poulose@arm.com>
      Cc: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
      Cc: Catalin Marinas <Catalin.Marinas@arm.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
      0cc5281a