[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190531181430.t4katzn66ajhfpgc@linutronix.de>
Date: Fri, 31 May 2019 20:14:31 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, tglx@...utronix.de,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next 1/7] net: Don't disable interrupts in
napi_alloc_frag()
On 2019-05-29 15:48:51 [-0700], Eric Dumazet wrote:
> > +
> > + fragsz = SKB_DATA_ALIGN(fragsz);
> > + if (irqs_disabled()) {
>
>
> What is the difference between this prior test, and the following ?
>
> if (in_irq() || irqs_disabled())
>
> I am asking because I see the latter being used in __dev_kfree_skb_any()
in_irq() is always true in hardirq context which is true for non-NAPI
drivers. If in_irq() is true, irqs_disabled() will also be true.
So I *think* I could replace the irqs_disabled() check with in_irq()
which should be cheaper because it just checks the preempt counter.
Sebastian
Powered by blists - more mailing lists