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: <87cztr1zxz.ffs@nanos.tec.linutronix.de>
Date:   Sat, 15 May 2021 22:53:28 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Jakub Kicinski <kuba@...nel.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     davem@...emloft.net, netdev@...r.kernel.org,
        eric.dumazet@...il.com, simon.horman@...ronome.com,
        oss-drivers@...ronome.com, Juri Lelli <juri.lelli@...hat.com>,
        Clark Williams <williams@...hat.com>
Subject: Re: [PATCH net-next 1/2] net: add a napi variant for RT-well-behaved drivers

On Sat, May 15 2021 at 13:31, Jakub Kicinski wrote:
> On Sat, 15 May 2021 13:07:40 +0200 Sebastian Andrzej Siewior wrote:
>> Now assume another interrupt comes in which wakes a force-threaded
>> handler (while ksoftirqd is preempted). Before the forced-threaded
>> handler is invoked, BH is disabled via local_bh_disable(). Since
>> ksoftirqd is preempted with BH disabled, disabling BH forces the
>> ksoftirqd thread to the priority of the interrupt thread (SCHED_FIFO,
>> prio 50 by default) due to the priority inheritance protocol. The
>> threaded handler will run once ksoftirqd is done which has now been
>> accelerated.
>
> Thanks for the explanation. I'm not married to the patch, if you prefer
> we can keep the status quo.
>
> I'd think, however, that always deferring to ksoftirqd is conceptually
> easier to comprehend. For power users who need networking there is
> prefer-busy-poll (which allows application to ask the kernel to service
> queues when it wants to, with some minimal poll frequency guarantees)
> and threaded NAPI - which some RT users already started to adapt.
>
> Your call.
>
>> Part of the problem from RT perspective is the heavy use of softirq and
>> the BH disabled regions which act as a BKL. I *think* having the network
>> driver running in a thread would be better (in terms of prioritisation).
>> I know, davem explained the benefits of NAPI/softirq when it comes to
>> routing/forwarding (incl. NET_RX/TX priority) and part where NAPI kicks
>> in during a heavy load (say a packet flood) and system is still
>> responsible.
>
> Right, although with modern multi-core systems where only a subset 
> of cores process network Rx things look different.

Bah, I completely forgot about that aspect. Thanks Sebastian for
bringing it up. I was too focussed on the other questions and there is
obviously the onset of alzheimer.

Anyway it's a touch choice to make. There are too many options to chose
from nowadays. 10 years ago running the softirq at the back of the
threaded irq handler which just scheduled NAPI was definitely a win, but
with threaded NAPI, zero copy and other things it's not that important
anymore IMO. But I might be missing something obviously.

I've cc'ed a few RT folks @RHT who might give some insight.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ