From acbded78c27278c842250c6dc79f34982107dc4e Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 7 Nov 2022 10:45:39 +0000 Subject: [PATCH] Run the ND6 expiry timer without kernel lock Added in 2017 to Reduce contention on the NET_LOCK() by moving the nd6 address expiration task to the `softnettq`. This should no longer be needed thanks to sys/net/if.c r1.652 in 2022: Activate parallel IP forwarding. Start 4 softnet tasks. Limit the usage to the number of CPUs. Nothing in nd6_expire() or nd6_expire_timer_update() requires protection by the kernel lock. The interface list and per-interface address lists remain protected by the net lock. Tests by Hrvoje OK mpi --- sys/netinet6/nd6.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 4a6f4b49729..e65eeb0c2ac 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.248 2022/09/09 12:05:52 kn Exp $ */ +/* $OpenBSD: nd6.c,v 1.249 2022/11/07 10:45:39 kn Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -446,8 +446,6 @@ nd6_expire_timer_update(struct in6_ifaddr *ia6) time_t expire_time = INT64_MAX; int secs; - KERNEL_ASSERT_LOCKED(); - if (ia6->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) expire_time = ia6->ia6_lifetime.ia6t_expire; @@ -486,7 +484,6 @@ nd6_expire(void *unused) { struct ifnet *ifp; - KERNEL_LOCK(); NET_LOCK(); TAILQ_FOREACH(ifp, &ifnetlist, if_list) { @@ -509,7 +506,6 @@ nd6_expire(void *unused) } NET_UNLOCK(); - KERNEL_UNLOCK(); } void -- 2.20.1