All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Ted Ts'o" <tytso@mit.edu>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg KH <greg@kroah.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: printk() vs tty_io
Date: Wed, 14 Dec 2011 15:23:51 +0100	[thread overview]
Message-ID: <1323872631.28489.37.camel@twins> (raw)
In-Reply-To: <20111214140527.GA18080@thunk.org>

On Wed, 2011-12-14 at 09:05 -0500, Ted Ts'o wrote:
> On Wed, Dec 14, 2011 at 11:56:46AM +0100, Peter Zijlstra wrote:
> > 
> > Well, this was the 8250 serial port driver doing wakeups. Its a simple
> > on-board serial port,
> > 
> > [   29.797007]        [<ffffffff8108a650>] __wake_up_common+0x4e/0x84
> > [   29.797007]        [<ffffffff8108d6ea>] __wake_up+0x39/0x4d
> > [   29.797007]        [<ffffffff8135d0db>] tty_wakeup+0x5b/0x60
> > [   29.797007]        [<ffffffff81373fb9>] uart_write_wakeup+0x21/0x23
> > [   29.797007]        [<ffffffff81376899>] transmit_chars+0xd8/0x12f
> > [   29.797007]        [<ffffffff81377f3a>] serial8250_handle_port+0x2d9/0x2fd
> > [   29.797007]        [<ffffffff81377fcb>] serial8250_handle_irq+0x16/0x1d
> > [   29.797007]        [<ffffffff81377ff5>] serial8250_default_handle_irq+0x23/0x27
> > [   29.797007]        [<ffffffff81377ade>] serial8250_interrupt+0x4d/0xc6
> > [   29.797007]        [<ffffffff810c9ae8>] handle_irq_event_percpu+0xab/0x1fc
> > [   29.797007]        [<ffffffff810c9c7a>] handle_irq_event+0x41/0x61
> > [   29.797007]        [<ffffffff810cc4cd>] handle_edge_irq+0xd1/0xf6
> > [   29.797007]        [<ffffffff8103ab85>] handle_irq+0x24/0x2f
> > [   29.797007]        [<ffffffff8150acdd>] do_IRQ+0x4d/0xb3
> > 
> > which places the wakeup under uport->lock, serial8250_console_write()
> > takes uport->lock, under console_sem, connecting the locks.
> 
> printk() goes through serial8250_console_write() which writes to the
> UART device using a busy loop, with local IRQ's disabled.  So it's not
> serial8250_console_write() which is waking things up; this is coming
> form interrupt handler running on some different CPU.

Which can still deadlock you just fine..

  reply	other threads:[~2011-12-14 14:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 19:33 printk() vs tty_io Peter Zijlstra
2011-12-13 23:52 ` Linus Torvalds
2011-12-14  9:38   ` Peter Zijlstra
2011-12-14 10:43   ` Alan Cox
2011-12-14 10:56     ` Peter Zijlstra
2011-12-14 14:05       ` Ted Ts'o
2011-12-14 14:23         ` Peter Zijlstra [this message]
2011-12-14 15:54           ` Linus Torvalds
2011-12-15  9:56             ` Peter Zijlstra
2011-12-15 10:32               ` Alan Cox
2011-12-15 10:55                 ` Peter Zijlstra
2011-12-15 17:08               ` Linus Torvalds
2011-12-15 18:07                 ` Ingo Molnar
2011-12-15 21:22                 ` Alan Cox
2011-12-16 13:25                 ` Peter Zijlstra
2011-12-15 19:02               ` Greg KH
2011-12-14  6:59 ` Ingo Molnar
2011-12-14  9:40   ` [PATCH] arch, early_printk: Consolidate early_printk() implementations Peter Zijlstra
2011-12-14  9:41   ` [PATCH] lockdep: Enable earlyprintk output Peter Zijlstra
2011-12-14  9:43   ` printk() vs tty_io Peter Zijlstra
2011-12-14  9:46     ` Ingo Molnar
2011-12-21 12:03 ` Stijn Devriendt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323872631.28489.37.camel@twins \
    --to=peterz@infradead.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.