public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* is printk() safe within a timekeeper_seq write section?
@ 2014-03-06 17:45 Jiri Bohac
  2014-03-11 19:29 ` John Stultz
  2014-03-12  9:18 ` Peter Zijlstra
  0 siblings, 2 replies; 14+ messages in thread
From: Jiri Bohac @ 2014-03-06 17:45 UTC (permalink / raw)
  To: John Stultz, linux-kernel; +Cc: Peter Zijlstra

Hi,

I'm looking at the printk call in
__timekeeping_inject_sleeptime(), introduced in cb5de2f8
(time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime)

Is it safe to call printk() while timekeeper_seq is held for
writing?

What about this call chain?
  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, ...)
		  

It looks like an unlikely but possible deadlock. 
Or did I overlook something?

Thanks!

-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-03-28  0:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06 17:45 is printk() safe within a timekeeper_seq write section? Jiri Bohac
2014-03-11 19:29 ` John Stultz
2014-03-11 21:32   ` Thomas Gleixner
2014-03-11 21:54     ` John Stultz
2014-03-12  6:49       ` Peter Zijlstra
2014-03-12  9:21       ` Jiri Bohac
2014-03-28  0:49         ` John Stultz
2014-03-12  6:46     ` Peter Zijlstra
2014-03-12 14:34       ` Jan Kara
2014-03-12 15:06         ` Peter Zijlstra
2014-03-14 15:13           ` Jan Kara
2014-03-12 13:13     ` Jan Kara
2014-03-12  9:25   ` Peter Zijlstra
2014-03-12  9:18 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox