Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-netpoll-remove-dead-code-and-speed-up-rtnl-locked-region'

Breno Leitao says:

====================
net: netpoll: remove dead code and speed up rtnl-locked region

This patchset introduces two minor modernizations to the netpoll
infrastructure:

The first patch removes the unused netpoll pointer from the netpoll_info
structure. This member is redundant and its presence does not benefit
multi-instance setups, as reported by Jay Vosburgh. Eliminating it cleans up
the structure and removes unnecessary code.

The second patch updates the netpoll resource cleanup routine to use
synchronize_net() instead of synchronize_rcu(). As __netpoll_free() is always
called under the RTNL lock, using synchronize_net() leverages the more
efficient synchronize_rcu_expedited() in these contexts, reducing time spent in
critical sections and improving performance.

Both changes simplify maintenance and enhance efficiency without altering
netpoll behavior.
====================

Link: https://patch.msgid.link/20250918-netpoll_jv-v1-0-67d50eeb2c26@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+1 -3
-1
include/linux/netpoll.h
··· 55 55 56 56 struct delayed_work tx_work; 57 57 58 - struct netpoll *netpoll; 59 58 struct rcu_head rcu; 60 59 }; 61 60
+1 -2
net/core/netpoll.c
··· 591 591 592 592 np->dev = ndev; 593 593 strscpy(np->dev_name, ndev->name, IFNAMSIZ); 594 - npinfo->netpoll = np; 595 594 596 595 /* fill up the skb queue */ 597 596 refill_skbs(np); ··· 834 835 ASSERT_RTNL(); 835 836 836 837 /* Wait for transmitting packets to finish before freeing. */ 837 - synchronize_rcu(); 838 + synchronize_net(); 838 839 __netpoll_cleanup(np); 839 840 kfree(np); 840 841 }