@@ -74,6 +74,8 @@ struct bpf_prog;
struct xdp_buff;
void synchronize_net(void);
+void synchronize_net_expedited(void);
+
void netdev_set_default_ethtool_ops(struct net_device *dev,
const struct ethtool_ops *ops);
@@ -10633,6 +10633,19 @@ void synchronize_net(void)
}
EXPORT_SYMBOL(synchronize_net);
+/**
+ * synchronize_net_expedited - synchronize_net, but always expedited
+ *
+ * Some callers may have reasons other than "RTNL held" to want expedited
+ * RCU sync. A prominent example is if the RCU delay is user visible.
+ */
+void synchronize_net_expedited(void)
+{
+ might_sleep();
+ synchronize_rcu_expedited();
+}
+EXPORT_SYMBOL(synchronize_net_expedited);
+
/**
* unregister_netdevice_queue - remove device from the kernel
* @dev: device
The AF_PACKET code has a bunch of calls to synchronize_net() while in a syscall from userland. These become very visible in some applications (e.g. just plain starting wireshark when the system has a lot of interfaces.) Add a "synchronize_net_expedited()" for cases like these. Signed-off-by: David Lamparter <equinox@diac24.net> --- include/linux/netdevice.h | 2 ++ net/core/dev.c | 13 +++++++++++++ 2 files changed, 15 insertions(+)