Thread (7 messages) 7 messages, 3 authors, 2009-07-13

Re: [PATCH] NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.

From: David Miller <davem@davemloft.net>
Date: 2009-07-13 17:31:36
Also in: linux-hams

From: Alan Cox <redacted>
Date: Mon, 13 Jul 2009 09:19:28 +0100
Historically it went

		network bh
			transmit packet
				ldisc layer
					tty write method

and lots of code assumed that.
They still can assume such things.  All locking is BH based, all
networking transmit paths occur in BH or with BH's disabled, never in
hardware interrupt context.

Even TX reclaim hardware interrupts that free SKBs reschedule that
work to BH context.
Today the network bits get kicked off at IRQ level.
That would be news to me :)

Where do you see that in the traces that Ralf posted?  His trace was
in fact a TTY receive path via USB:

cpu_idle()
	handle_IRQ_event()
	uhci_irq()
	ftdi_read_bulk_callback()
	ftdi_process_read()
	tty_flip_buffer()
		flush_to_ldisc()
		mkiss_receive_buf()
		spin_lock_bh() --> BH disable in hard IRQ, OH NOEZ!

And, as Ralf's changelog stated:

--------------------
The issue was, that the locking code in mkiss was assuming it was only
ever being called in process or bh context.  Fixed by converting the
involved locking code to use irq-safe locks.
--------------------

mkiss_receive_buf(), the problematic code path, is invoked by
the TTY layer directly from LDISC flushing and the TTY device's
IRQ handler here.

How does networking's TX policy have anything to do with this?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help