1. 22 11月, 2014 1 次提交
    • P
      time: Avoid possible NTP adjustment mult overflow. · 6067dc5a
      pang.xunlei 提交于
      Ideally, __clocksource_updatefreq_scale, selects the largest shift
      value possible for a clocksource. This results in the mult memember of
      struct clocksource being particularly large, although not so large
      that NTP would adjust the clock to cause it to overflow.
      
      That said, nothing actually prohibits an overflow from occuring, its
      just that it "shouldn't" occur.
      
      So while very unlikely, and so far never observed, the value of
      (cs->mult+cs->maxadj) may have a chance to reach very near 0xFFFFFFFF,
      so there is a possibility it may overflow when doing NTP positive
      adjustment
      
      See the following detail: When NTP slewes the clock, kernel goes
      through update_wall_time()->...->timekeeping_apply_adjustment():
      	tk->tkr.mult += mult_adj;
      
      Since there is no guard against it, its possible tk->tkr.mult may
      overflow during this operation.
      
      This patch avoids any possible mult overflow by judging the overflow
      case before adding mult_adj to mult, also adds the WARNING message
      when capturing such case.
      Signed-off-by: Npang.xunlei <pang.xunlei@linaro.org>
      [jstultz: Reworded commit message]
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      6067dc5a
  2. 06 9月, 2014 1 次提交
  3. 15 8月, 2014 1 次提交
  4. 24 7月, 2014 33 次提交
  5. 05 6月, 2014 1 次提交
    • J
      timekeeping: use printk_deferred when holding timekeeping seqlock · 6d9bcb62
      John Stultz 提交于
      Jiri Bohac pointed out that there are rare but potential deadlock
      possibilities when calling printk while holding the timekeeping
      seqlock.
      
      This is due to printk() triggering console sem wakeup, which can
      cause scheduling code to trigger hrtimers which may try to read
      the time.
      
      Specifically, as Jiri pointed out, that path is:
        printk
          vprintk_emit
            console_unlock
              up(&console_sem)
                __up
      	    wake_up_process
      	      try_to_wake_up
      	        ttwu_do_activate
      		  ttwu_activate
      		    activate_task
      		      enqueue_task
      		        enqueue_task_fair
      			  hrtick_update
      			    hrtick_start_fair
      			      hrtick_start_fair
      			        get_time
      				  ktime_get
      				    --> endless loop on
      				    read_seqcount_retry(&timekeeper_seq, ...)
      
      This patch tries to avoid this issue by using printk_deferred (previously
      named printk_sched) which should defer printing via a irq_work_queue.
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Reported-by: NJiri Bohac <jbohac@suse.cz>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6d9bcb62
  6. 08 4月, 2014 1 次提交
  7. 28 3月, 2014 1 次提交
  8. 24 12月, 2013 1 次提交