1. 15 5月, 2017 1 次提交
    • P
      x86/tsc, sched/clock, clocksource: Use clocksource watchdog to provide stable sync points · b421b22b
      Peter Zijlstra 提交于
      Currently we keep sched_clock_tick() active for stable TSC in order to
      keep the per-CPU state semi up-to-date. The (obvious) problem is that
      by the time we detect TSC is borked, our per-CPU state is also borked.
      
      So hook into the clocksource watchdog and call a method after we've
      found it to still be stable.
      
      There's the obvious race where the TSC goes wonky between finding it
      stable and us running the callback, but closing that is too much work
      and not really worth it, since we're already detecting TSC wobbles
      after the fact, so we cannot, per definition, fully avoid funny clock
      values.
      
      And since the watchdog runs less often than the tick, this is also an
      optimization.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      b421b22b
  2. 20 4月, 2017 1 次提交
  3. 14 1月, 2017 1 次提交
  4. 25 12月, 2016 1 次提交
  5. 30 11月, 2016 1 次提交
  6. 28 6月, 2016 2 次提交
  7. 23 4月, 2016 1 次提交
  8. 27 2月, 2016 1 次提交
  9. 26 11月, 2015 1 次提交
    • T
      timekeeping: Lift clocksource cacheline restriction · 09a99820
      Thomas Gleixner 提交于
      We cache all hotpath members of a clocksource in the time keeper
      core. So there is no requirement in general to cache line align struct
      clocksource. Remove the enforces alignment.
      
      That allows users which need to wrap struct clocksource into their own
      struct to align the struct without getting extra padding.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
      Cc: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mans Rullgard <mans@mansr.com>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Nicolas Pitre <nico@linaro.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Sebastian Frias <sebastian_frias@sigmadesigns.com>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1511191209000.3898@nanos
      09a99820
  10. 01 10月, 2015 4 次提交
  11. 22 4月, 2015 1 次提交
  12. 26 3月, 2015 1 次提交
  13. 13 3月, 2015 2 次提交
  14. 12 3月, 2015 1 次提交
  15. 31 12月, 2014 1 次提交
  16. 23 10月, 2014 1 次提交
    • B
      clocksource: Remove "weak" from clocksource_default_clock() declaration · 96a2adbc
      Bjorn Helgaas 提交于
      kernel/time/jiffies.c provides a default clocksource_default_clock()
      definition explicitly marked "weak".  arch/s390 provides its own definition
      intended to override the default, but the "weak" attribute on the
      declaration applied to the s390 definition as well, so the linker chose one
      based on link order (see 10629d71 ("PCI: Remove __weak annotation from
      pcibios_get_phb_of_node decl")).
      
      Remove the "weak" attribute from the clocksource_default_clock()
      declaration so we always prefer a non-weak definition over the weak one,
      independent of link order.
      
      Fixes: f1b82746 ("clocksource: Cleanup clocksource selection")
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJohn Stultz <john.stultz@linaro.org>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      CC: Daniel Lezcano <daniel.lezcano@linaro.org>
      CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
      96a2adbc
  17. 24 7月, 2014 1 次提交
  18. 21 5月, 2014 1 次提交
  19. 31 7月, 2013 1 次提交
  20. 05 7月, 2013 1 次提交
    • T
      clocksource: Reselect clocksource when watchdog validated high-res capability · 332962f2
      Thomas Gleixner 提交于
      Up to commit 5d33b883 (clocksource: Always verify highres capability)
      we had no sanity check when selecting a clocksource, which prevented
      that a non highres capable clocksource is used when the system already
      switched to highres/nohz mode.
      
      The new sanity check works as Alex and Tim found out. It prevents the
      TSC from being used. This happens because on x86 the boot process
      looks like this:
      
       tsc_start_freqency_validation(TSC);
       clocksource_register(HPET);
       clocksource_done_booting();
      	clocksource_select()
      		Selects HPET which is valid for high-res
      
       switch_to_highres();
      
       clocksource_register(TSC);
       	TSC is not selected, because it is not yet
      	flagged as VALID_HIGH_RES
      
       clocksource_watchdog()
      	Validates TSC for highres, but that does not make TSC
      	the current clocksource.
      
      Before the sanity check was added, we installed TSC unvalidated which
      worked most of the time. If the TSC was really detected as unstable,
      then the unstable logic removed it and installed HPET again.
      
      The sanity check is correct and needed. So the watchdog needs to kick
      a reselection of the clocksource, when it qualifies TSC as a valid
      high res clocksource.
      
      To solve this, we mark the clocksource which got the flag
      CLOCK_SOURCE_VALID_FOR_HRES set by the watchdog with an new flag
      CLOCK_SOURCE_RESELECT and trigger the watchdog thread. The watchdog
      thread evaluates the flag and invokes clocksource_select() when set.
      
      To avoid that the clocksource_done_booting() code, which is about to
      install the first real clocksource anyway, needs to go through
      clocksource_select and tick_oneshot_notify() pointlessly, split out
      the clocksource_watchdog_kthread() list walk code and invoke the
      select/notify only when called from clocksource_watchdog_kthread().
      
      So clocksource_done_booting() can utilize the same splitout code
      without the select/notify invocation and the clocksource_mutex
      unlock/relock dance.
      Reported-and-tested-by: NAlex Shi <alex.shi@intel.com>
      Cc: Hans Peter Anvin <hpa@linux.intel.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Andi Kleen <andi.kleen@intel.com>
      Tested-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1307042239150.11637@ionos.tec.linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      332962f2
  21. 16 5月, 2013 3 次提交
  22. 28 3月, 2013 1 次提交
  23. 20 3月, 2013 1 次提交
  24. 16 3月, 2013 1 次提交
  25. 11 3月, 2013 1 次提交
  26. 01 2月, 2013 1 次提交
  27. 03 1月, 2013 1 次提交
    • S
      clocksource: add common of_clksrc_init() function · ae278a93
      Stephen Warren 提交于
      It is desirable to move all clocksource drivers to drivers/clocksource,
      yet each requires its own initialization function. We'd rather not
      pollute <linux/> with a header for each function. Instead, create a
      single of_clksrc_init() function which will determine which clocksource
      driver to initialize based on device tree.
      
      Based on a similar patch for drivers/irqchip by Thomas Petazzoni.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      ae278a93
  28. 25 9月, 2012 1 次提交
    • J
      time: Move update_vsyscall definitions to timekeeper_internal.h · 189374ae
      John Stultz 提交于
      Since users will need to include timekeeper_internal.h, move
      update_vsyscall definitions to timekeeper_internal.h.
      
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      189374ae
  29. 02 2月, 2012 1 次提交
  30. 19 12月, 2011 1 次提交
  31. 11 11月, 2011 1 次提交
    • J
      clocksource: Avoid selecting mult values that might overflow when adjusted · d65670a7
      John Stultz 提交于
      For some frequencies, the clocks_calc_mult_shift() function will
      unfortunately select mult values very close to 0xffffffff.  This
      has the potential to overflow when NTP adjusts the clock, adding
      to the mult value.
      
      This patch adds a clocksource.maxadj value, which provides
      an approximation of an 11% adjustment(NTP limits adjustments to
      500ppm and the tick adjustment is limited to 10%), which could
      be made to the clocksource.mult value. This is then used to both
      check that the current mult value won't overflow/underflow, as
      well as warning us if the timekeeping_adjust() code pushes over
      that 11% boundary.
      
      v2: Fix max_adjustment calculation, and improve WARN_ONCE
      messages.
      
      v3: Don't warn before maxadj has actually been set
      
      CC: Yong Zhang <yong.zhang0@gmail.com>
      CC: David Daney <ddaney.cavm@gmail.com>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Chen Jie <chenj@lemote.com>
      CC: zhangfx <zhangfx@lemote.com>
      CC: stable@kernel.org
      Reported-by: NChen Jie <chenj@lemote.com>
      Reported-by: Nzhangfx <zhangfx@lemote.com>
      Tested-by: NYong Zhang <yong.zhang0@gmail.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      d65670a7
  32. 22 7月, 2011 1 次提交
  33. 15 7月, 2011 1 次提交