lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ