1. 29 10月, 2014 1 次提交
    • H
      timekeeping: Provide fast accessor to the seconds part of CLOCK_MONOTONIC · 9e3680b1
      Heena Sirwani 提交于
      This is the counterpart to get_seconds() based on CLOCK_MONOTONIC. The
      use case for this interface are kernel internal coarse grained
      timestamps which do neither require the nanoseconds fraction of
      current time nor the CLOCK_REALTIME properties. Such timestamps can
      currently only retrieved by calling ktime_get_ts64() and using the
      tv_sec field of the returned timespec64. That's inefficient as it
      involves the read of the clocksource, math operations and must be
      protected by the timekeeper sequence counter.
      
      To avoid the sequence counter protection we restrict the return value
      to unsigned 32bit on 32bit machines. This covers ~136 years of uptime
      and therefor an overflow is not expected to hit anytime soon.
      
      To avoid math in the function we calculate the current seconds portion
      of CLOCK_MONOTONIC when the timekeeper gets updated in
      tk_update_ktime_data() similar to the CLOCK_REALTIME counterpart
      xtime_sec.
      
      [ tglx: Massaged changelog, simplified and commented the update
        	function, added docbook comment ]
      Signed-off-by: NHeena Sirwani <heenasirwani@gmail.com>
      Reviewed-by: NArnd Bergman <arnd@arndb.de>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: opw-kernel@googlegroups.com
      Link: http://lkml.kernel.org/r/da0b63f4bdf3478909f92becb35861197da3a905.1414578445.git.heenasirwani@gmail.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      9e3680b1
  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 次提交