summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2022-11-07 10:45:40 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2022-11-07 10:45:40 +0000
commit53cf9ceacf11b287d16f727b215b437ddea6f205 (patch)
tree0b35b8edce1ca5e3de25cfdaf766c45c1b9afe21
parentae8fa8e38df115a1ea86b802d6bddc7aff1e3b94 (diff)
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
-rw-r--r--sys/netinet6/nd6.c6
1 files changed, 1 insertions, 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