netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Ben Greear <greearb@candelatech.com>
Cc: netdev@oss.sgi.com
Subject: Re: local_bh_enable & hard_start_xmit
Date: Mon, 18 Apr 2005 15:14:21 -0700	[thread overview]
Message-ID: <20050418151421.41a8f64a.davem@davemloft.net> (raw)
In-Reply-To: <42642892.2040300@candelatech.com>

On Mon, 18 Apr 2005 14:37:22 -0700
Ben Greear <greearb@candelatech.com> wrote:

> So, two questions:
> 
> 1)  Why is it bad to have interrupts disabled when calling
>      the local_bh_enable() method?

Because it creates a deadlock.  You can always take hard IRQ disabling
locks inside of BH disabling ones, but _never_ the other way around.

local_bh_enable() potentially runs BH handlers, and this must occur with
hard IRQs enabled.

> 2)  Should there be a hard requirement that one must never have IRQs disabled
>      when calling dev->hard_start_xmit  (this requirement seems to currently
>      be in effect because VLANs can call dev_queue_xmit from their hard_start_xmit
>      method, and it appears that dev_queue_xmit must not be called with IRQs disabled).

Yes, it is another true requirement.

I even tried to disable hard IRQs during ->hard_start_xmit() to fix a
LLTX locking bug and it totally broke things.

There are ->hard_start_xmit() routines for very slow
devices which expect that jiffies continues to increment via timer
interrupts so that they can timeout feeding bytes to the chip properly.
Also, again with slow devices, it is expected that hard IRQs are enabled
so that your serial ports don't overrun.

In general, it's anti-social to IRQ response time sensitive devices in the
machine to disable hard IRQs for any non-trivial stretch of code.

  reply	other threads:[~2005-04-18 22:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18 21:37 local_bh_enable & hard_start_xmit Ben Greear
2005-04-18 22:14 ` David S. Miller [this message]
2005-04-18 22:59   ` Ben Greear
2005-04-18 23:01     ` David S. Miller
2005-04-18 23:17       ` Ben Greear
2005-04-19  0:24       ` Ben Greear
     [not found]         ` <20050419231442.7e37b087.davem@davemloft.net>
2005-04-22 19:39           ` Ben Greear
2005-04-25  3:13             ` David S. Miller

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=20050418151421.41a8f64a.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=greearb@candelatech.com \
    --cc=netdev@oss.sgi.com \
    /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).