netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: alan@lxorguk.ukuu.org.uk
Cc: ralf@linux-mips.org, netdev@vger.kernel.org,
	guido@trentalancia.com, paulus@samba.org,
	linux-hams@vger.kernel.org, hans@esrac.ele.tue.nl
Subject: Re: [PATCH] NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
Date: Mon, 13 Jul 2009 10:31:39 -0700 (PDT)	[thread overview]
Message-ID: <20090713.103139.188324296.davem@davemloft.net> (raw)
In-Reply-To: <20090713091928.7e89bab8@lxorguk.ukuu.org.uk>

From: Alan Cox <alan@lxorguk.ukuu.org.uk>
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?

  reply	other threads:[~2009-07-13 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-12 17:27 NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines Ralf Baechle
2009-07-12 22:26 ` [PATCH] " Ralf Baechle DL5RB
2009-07-12 22:48   ` Alan Cox
2009-07-13  4:07     ` David Miller
2009-07-13  8:19       ` Alan Cox
2009-07-13 17:31         ` David Miller [this message]
2009-07-13 19:27           ` Alan Cox

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=20090713.103139.188324296.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=guido@trentalancia.com \
    --cc=hans@esrac.ele.tue.nl \
    --cc=linux-hams@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).