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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201016154046.llepbidazcqx7yyj@skbuf>
Date:   Fri, 16 Oct 2020 18:40:46 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Heiner Kallweit <hkallweit1@...il.com>
Cc:     Mike Galbraith <efault@....de>, netdev <netdev@...r.kernel.org>,
        Realtek linux nic maintainers <nic_swsd@...ltek.com>
Subject: Re: [patchlet] r8169: fix napi_schedule_irqoff() called with irqs
 enabled warning

On Fri, Oct 16, 2020 at 04:41:50PM +0200, Heiner Kallweit wrote:
> On 16.10.2020 16:26, Vladimir Oltean wrote:
> > On Fri, Oct 16, 2020 at 01:34:55PM +0200, Heiner Kallweit wrote:
> >> I'm aware of the topic, but missing the benefits of the irqoff version
> >> unconditionally doesn't seem to be the best option.
> > 
> > What are the benefits of the irqoff version? As far as I see it, the
> > only use case for that function is when the caller has _explicitly_
> > disabled interrupts.
> > 
> If the irqoff version wouldn't have a benefit, then I think we wouldn't
> have it ..
> 
> > The plain napi_schedule call will check if irqs are disabled. If they
> > are, it won't do anything further in that area. There is no performance
> > impact except for a check.
> > 
> There is no such check, and in general currently attempts are made to
> remove usage of e.g. in_interrupt(). napi_schedule() has additional calls
> to local_irq_save() and local_irq_restore().

This has nothing to do with in_interrupt().

Now, to explain where my confusion came from.
arm64 has this:

static inline unsigned long arch_local_irq_save(void)
{
	unsigned long flags;

	flags = arch_local_save_flags();

	/*
	 * There are too many states with IRQs disabled, just keep the current
	 * state if interrupts are already disabled/masked.
	 */
	if (!arch_irqs_disabled_flags(flags))
		arch_local_irq_disable();

	return flags;
}

I just thought that the generic implementation had the "if" too.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ