All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: "David S. Miller" <davem@redhat.com>
Cc: benh@kernel.crashing.org, linux-kernel@vger.kernel.org,
	netdev@oss.sgi.com
Subject: Re: Problem with dev_kfree_skb_any() in 2.6.0
Date: Thu, 1 Jan 2004 21:58:07 -0500	[thread overview]
Message-ID: <20040102025807.GB3851@gtf.org> (raw)
In-Reply-To: <20040101124218.258e8b73.davem@redhat.com>

On Thu, Jan 01, 2004 at 12:42:18PM -0800, David S. Miller wrote:
> On Tue, 30 Dec 2003 12:43:21 -0500
> Jeff Garzik <jgarzik@pobox.com> wrote:
> 
> > Luckily, I feel there is an easy solution, as shown in the attached 
> > patch.  We _already_ queue skbs in dev_kfree_skb_irq().  Therefore, 
> > dev_kfree_skb_any() can simply use precisely that same solution.  The 
> > raise-softirq code will immediately proceed to action if we are not in 
> > hard IRQ context, otherwise it will follow the expected path.
> 
> Ok, this is reasonable and works.
> 
> Though, is there any particular reason you don't like adding a
> "|| irqs_disabled()" check to the if statement instead?
> I prefer that solution better actually.

Yep, in fact when I wrote the above message, I came across a couple when I
was pondering...
* the destructor runs in a more predictable context.
* given the problem that started this thread, the 'if' test is a
  potentially problematic area.  Why not eliminate all possibility that
  this problem will occur again?

The only counter argument to this -- to which I have no data to answer --
is that there may be advantage to calling __kfree_skb immediately
instead of deferring it slightly.  I didn't think that disadvantage
outweighted the above, but who knows...  I can possibly be convinced
otherwise.  (and "otherwise" would be using || irqs_disabled())

For the users who don't know/don't care about their context, it just
seemed to me that they were not a hot path like users of dev_kfree_skb()
and dev_kfree_skb_irq() [unconditional] are...

	Jeff




  reply	other threads:[~2004-01-02  2:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-27 23:17 Problem with dev_kfree_skb_any() in 2.6.0 Benjamin Herrenschmidt
2003-12-28  1:07 ` David S. Miller
2003-12-28  5:44   ` Benjamin Herrenschmidt
2003-12-30  4:09   ` Jeff Garzik
2003-12-30  4:51     ` David S. Miller
2003-12-30  5:15       ` Jeff Garzik
2003-12-30  6:01         ` David S. Miller
2003-12-30  6:12           ` Jeff Garzik
2003-12-30  6:13             ` David S. Miller
2003-12-30 17:43               ` Jeff Garzik
2004-01-01 20:42                 ` David S. Miller
2004-01-02  2:58                   ` Jeff Garzik [this message]
2004-01-06  3:54                     ` David S. Miller
2004-03-29 15:46                     ` David S. Miller
2003-12-30  6:14       ` Benjamin Herrenschmidt

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=20040102025807.GB3851@gtf.org \
    --to=jgarzik@pobox.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.