LWN: Comments on "NAPI polling in kernel threads" https://lwn.net/Articles/833840/ This is a special feed containing comments posted to the individual LWN article titled "NAPI polling in kernel threads". en-us Sat, 01 Nov 2025 04:11:40 +0000 Sat, 01 Nov 2025 04:11:40 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net NAPI polling in kernel threads https://lwn.net/Articles/835865/ https://lwn.net/Articles/835865/ immibis <div class="FormattedComment"> That sounds exactly like NOHZ_FULL<br> </div> Mon, 02 Nov 2020 17:00:56 +0000 NAPI polling in kernel threads https://lwn.net/Articles/835060/ https://lwn.net/Articles/835060/ amworsley <div class="FormattedComment"> About time. Having packets processed in high priority software IRQs is a gift to those who want to carry out denial of service attacks against CPU limited embedded processors.<br> </div> Sat, 24 Oct 2020 01:39:45 +0000 NAPI polling in kernel threads https://lwn.net/Articles/834314/ https://lwn.net/Articles/834314/ ncm <div class="FormattedComment"> Agreed, I don&#x27;t have any direct experience with DPDK. I have used Onload/Ef_vi for Solarflare hardware (sold by Xilinx, maybe soon AMD), libexanic for Exablaze hardware (sold by Cisco now), and Napatech. I have studied Netronome, which enables running eBPF on the packet before it hits host memory, that can drop the packet at that stage.<br> <p> Each has its own idiosyncratic filtering configuration and ring buffer layout. ExaNIC is unusual in delivering packets 120 bytes at a time, enabling partial processing while the rest of the packet is still coming in.<br> <p> There are various accommodations to use in VMs, which I have not experimented with.<br> <p> Keeping the kernel&#x27;s greedy fingers off of my cores is one of the harder parts of the job. It means lots of custom boot parameter incantations, making deployment to somebody else&#x27;s equipment a chore. It would be much, much better if the process could simply tell the kernel, &quot;I will not be doing any more system calls, please leave my core completely alone from this point&quot;, and have that stick. Such a process does all its subsequent work entirely via mapped memory. <br> </div> Wed, 14 Oct 2020 22:38:17 +0000 NAPI polling in kernel threads https://lwn.net/Articles/834192/ https://lwn.net/Articles/834192/ wkudla <div class="FormattedComment"> I don&#x27;t think they are referring to DPDK. It&#x27;s rather about solutions such as SolarFlare NICs and kernel bypass with OpenOnload.<br> It&#x27;s extremely popular in fintech and other latency sensitive fields.<br> <p> I can&#x27;t wait to get rid of softirqs from my critical CPUs. Those and tasklets are a nightmare when you&#x27;re trying to reduce platform jitter to the minimum.<br> </div> Tue, 13 Oct 2020 20:59:25 +0000 NAPI polling in kernel threads https://lwn.net/Articles/834101/ https://lwn.net/Articles/834101/ marcH <div class="FormattedComment"> You mean like DPDK?<br> <p> Any reason not to mention any specific example(s)?<br> </div> Tue, 13 Oct 2020 03:15:56 +0000 NAPI polling in kernel threads https://lwn.net/Articles/834087/ https://lwn.net/Articles/834087/ nevets <div class="FormattedComment"> My slides are there: <a href="https://blog.linuxplumbersconf.org/2009/slides/Steven-Rostedt-network-thread-irqs.pdf">https://blog.linuxplumbersconf.org/2009/slides/Steven-Ros...</a><br> </div> Mon, 12 Oct 2020 20:08:15 +0000 NAPI polling in kernel threads https://lwn.net/Articles/834086/ https://lwn.net/Articles/834086/ nevets <div class="FormattedComment"> Exactly! I proposed this work back in 2009 at Linux Plumbers. My idea was to call it &quot;ENAPI&quot; for &quot;Even-Newer API&quot;.<br> <p> <a href="https://blog.linuxplumbersconf.org/ocw/proposals/53">https://blog.linuxplumbersconf.org/ocw/proposals/53</a><br> <p> I may even be able to find my slides somewhere. There was a lot of skepticism about this approach (even from Eric Dumazet), but like threaded interrupts in general, I was confident that this would sooner or later be something that non RT folks would want.<br> </div> Mon, 12 Oct 2020 20:01:45 +0000 NAPI polling in kernel threads https://lwn.net/Articles/834008/ https://lwn.net/Articles/834008/ darwi <div class="FormattedComment"> <font class="QuotedText">&gt; I am aware, but NAPI is used only in networking AFAIK.</font><br> <p> Yes of course. My point was that RT runs almost all softirqs at kthread/task context, not just NAPI. Thus, RT handles the generic case (almost all softirqs), while the patch set mentioned in the article only handles one of its special cases (NAPI).<br> </div> Mon, 12 Oct 2020 03:40:47 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833992/ https://lwn.net/Articles/833992/ alison <div class="FormattedComment"> <font class="QuotedText">&gt; Softirqs are used still used in a big number of places beyond networking. </font><br> <p> I am aware, but NAPI is used only in networking AFAIK. Thanks for saying &quot;softirqs&quot; rather than &quot;software interrupts&quot;: ugh!<br> </div> Sun, 11 Oct 2020 22:16:57 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833980/ https://lwn.net/Articles/833980/ darwi <div class="FormattedComment"> <font class="QuotedText">&gt; Indeed, it makes one wonder if a new implementation is needed.</font><br> <p> Softirqs are used still used in a big number of places beyond networking. See the full list, enum *_SOFTIRQ, at include/linux/interrupt.h<br> </div> Sun, 11 Oct 2020 17:46:10 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833973/ https://lwn.net/Articles/833973/ itsmycpu <div class="FormattedComment"> It sounds like it can be toggled through sysfs. So much better than having to (re)compile the kernel. :)<br> </div> Sun, 11 Oct 2020 12:29:00 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833952/ https://lwn.net/Articles/833952/ tpo <div class="FormattedComment"> Wow, excellent article about fundamental mechanisms and concepts and how they are evolving. So much appreciated &lt;3 !<br> </div> Sat, 10 Oct 2020 15:41:59 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833940/ https://lwn.net/Articles/833940/ ncm <div class="FormattedComment"> Those of us who care most about performance and minimizing overhead are using &quot;kernel-bypass&quot; libraries with NICs that dump incoming packets into a ring buffer mapped into user-space memory. The kernel driver for such a NIC sets up filter criteria programmed into registers in an ASIC or FPGA on the NIC, and then leaves it to run freely DMAing incoming packets sequentially into the ring buffer interspersed with annotations like length, timestamp, and checksum, and updates an atomic shared index/pointer when the packet is ready.<br> <p> The user program just needs to poll for updates to this index, and then finish all its work on the packet before it gets overwritten, as little as a few ms later. That work might be just to copy the packet to a bigger ring buffer for other processes to look at under more-relaxed time constraints.<br> <p> The kernel driver watches its own mapping of such a ring buffer, and copies out packets that processes have expressed interest in to regular buffers to be delivered, or to be processed according to TCP protocol, e.g. to acknowledge, or to run them past the firewall first.<br> </div> Sat, 10 Oct 2020 08:40:15 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833938/ https://lwn.net/Articles/833938/ alison <div class="FormattedComment"> <font class="QuotedText">&gt; this would also be very helpful in making !RT and RT kernels closer...</font><br> <p> Indeed, it makes one wonder if a new implementation is needed.<br> <p> I suppose we&#x27;ll call this solution the NNAPI.<br> </div> Sat, 10 Oct 2020 04:30:05 +0000 NAPI polling in kernel threads https://lwn.net/Articles/833925/ https://lwn.net/Articles/833925/ darwi <div class="FormattedComment"> <font class="QuotedText">&gt; Once NAPI polling moves to its own kernel thread, it becomes much more visible and subject to administrator control. A kernel thread can have its priority changed, and it can be bound to a specific set of CPUs; that allows the administrator to adjust how that work is done in relation to the system&#x27;s user-space workload. Meanwhile, the CPU scheduler will have a better understanding of how much CPU time NAPI polling requires... Time spent handling software interrupts, instead, is nearly invisible to the scheduler. </font><br> <p> IMHO, this would also be very helpful in making !RT and RT kernels closer...<br> <p> PREEMPT_RT already runs softirqs in their own kernel threads, so that they can be prioritized and not affect random victims and real-time threads. Maybe, soon, all mainline kernels will be like RT in that regard ;-)<br> </div> Fri, 09 Oct 2020 20:54:55 +0000