Index | Thread | Search

From:
Vitaliy Makkoveev <otto@bsdbox.dev>
Subject:
Re: tcp timer without kernel lock
To:
Alexander Bluhm <alexander.bluhm@gmx.net>
Cc:
OpenBSD Tech <tech@openbsd.org>
Date:
Tue, 30 Jan 2024 01:29:07 +0300

Download raw body.

Thread
> On 30 Jan 2024, at 01:22, Alexander Bluhm <alexander.bluhm@gmx.net> wrote:
> 
> Hi
> 
> TCP timers are protected by exclusive net lock.  There is not reason
> for them to hold kernel lock.  Now that we have MP safe timeout,
> we can convert them.
> 
> ok?
> 

ok mvs

> bluhm
> 
> Index: netinet/tcp_timer.h
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/tcp_timer.h,v
> diff -u -p -r1.20 tcp_timer.h
> --- netinet/tcp_timer.h	14 Mar 2023 00:24:05 -0000	1.20
> +++ netinet/tcp_timer.h	29 Jan 2024 13:38:14 -0000
> @@ -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 {									\
>