netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: bigeasy@linutronix.de
Cc: edumazet@google.com, netdev@vger.kernel.org, tglx@linutronix.de
Subject: Re: [PATCH 1/2] net/core: use local_bh_disable() in netif_rx_ni()
Date: Tue, 20 Jun 2017 13:08:40 -0400 (EDT)	[thread overview]
Message-ID: <20170620.130840.472295224655944129.davem@davemloft.net> (raw)
In-Reply-To: <20170616172400.10809-1-bigeasy@linutronix.de>

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 16 Jun 2017 19:23:59 +0200

> In 2004 [0] netif_rx_ni() gained a preempt_disable() section around
> netif_rx() and its do_softirq() + testing for it. The do_softirq() part
> is required because netif_rx() raises the softirq but does not invoke
> it. The preempt_disable() is required to avoid running the BH in
> parallel.
> All this can be avoided be putting this into a local_bh_disable()ed
> section. The local_bh_enable() part will invoke do_softirq() if
> required.
> 
> [0] Make netif_rx_ni preempt-safe
>     http://oss.sgi.com/projects/netdev/archive/2004-10/msg02211.html
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Why make extra work?  The current code is cheaper.

Doing all of that dance with the local_bh_enable() function call is
more expensive than the inlined counter bump and softirq state
check.

I'm not applying this without a better justification, sorry.

      parent reply	other threads:[~2017-06-20 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 17:23 [PATCH 1/2] net/core: use local_bh_disable() in netif_rx_ni() Sebastian Andrzej Siewior
2017-06-16 17:24 ` [PATCH 2/2] net/core: remove explicit do_softirq() from busy_poll_stop() Sebastian Andrzej Siewior
2017-06-20 17:09   ` David Miller
2017-06-20 17:08 ` David Miller [this message]

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=20170620.130840.472295224655944129.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bigeasy@linutronix.de \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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).