From: bluhm Date: Mon, 29 Jan 2024 22:47:13 +0000 (+0000) Subject: Run TCP timer without kernel lock. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=94c283ed32be1fccd27925c46328bccb2dbd59a8;p=openbsd Run TCP timer without kernel lock. TCP timers are protected by exclusive net lock. They may sleep to grab it as they run in process context. There is no reason for them to hold additional kernel lock. Since we have MP safe timeouts now, convert them by adding TIMEOUT_PROC and TIMEOUT_MPSAFE flag. OK mvs@ --- diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 53027af4f3a..a26a7b3e38c 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_timer.h,v 1.20 2023/03/14 00:24:05 yasuoka Exp $ */ +/* $OpenBSD: tcp_timer.h,v 1.21 2024/01/29 22:47:13 bluhm Exp $ */ /* $NetBSD: tcp_timer.h,v 1.6 1995/03/26 20:32:37 jtc Exp $ */ /* @@ -117,7 +117,9 @@ const char *tcptimers[TCPT_NTIMERS] = * Init, arm, disarm, and test TCP timers. */ #define TCP_TIMER_INIT(tp, timer) \ - timeout_set_proc(&(tp)->t_timer[(timer)], tcp_timer_funcs[(timer)], tp) + timeout_set_flags(&(tp)->t_timer[(timer)], \ + tcp_timer_funcs[(timer)], tp, KCLOCK_NONE, \ + TIMEOUT_PROC | TIMEOUT_MPSAFE) #define TCP_TIMER_ARM(tp, timer, msecs) \ do { \