git: d021d3b3c675 - main - tcp: get rid of TDP_INTCPCALLOUT

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Thu, 24 Oct 2024 17:14:40 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=d021d3b3c67573822b01d27cb05ca937fc966843

commit d021d3b3c67573822b01d27cb05ca937fc966843
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2024-10-24 16:58:49 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-10-24 17:14:03 +0000

    tcp: get rid of TDP_INTCPCALLOUT
    
    With CALLOUT_TRYLOCK we don't need this special flag.
    
    Reviewed by:            jtl
    Differential Revision:  https://reviews.freebsd.org/D45748
---
 sys/netinet/tcp_timer.c | 9 +--------
 sys/sys/proc.h          | 2 +-
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index ae4753b2523f..c5c65dda5b1a 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -874,12 +874,8 @@ tcp_timer_enter(void *xtp)
 	struct inpcb *inp = tptoinpcb(tp);
 	sbintime_t precision;
 	tt_which which;
-	bool tp_valid;
 
 	INP_WLOCK_ASSERT(inp);
-	MPASS((curthread->td_pflags & TDP_INTCPCALLOUT) == 0);
-
-	curthread->td_pflags |= TDP_INTCPCALLOUT;
 
 	which = tcp_timer_next(tp, NULL);
 	MPASS(which < TT_N);
@@ -887,8 +883,7 @@ tcp_timer_enter(void *xtp)
 	tp->t_precisions[which] = 0;
 
 	tcp_bblog_timer(tp, which, TT_PROCESSING, 0);
-	tp_valid = tcp_timersw[which](tp);
-	if (tp_valid) {
+	if (tcp_timersw[which](tp)) {
 		tcp_bblog_timer(tp, which, TT_PROCESSED, 0);
 		if ((which = tcp_timer_next(tp, &precision)) != TT_N) {
 			MPASS(tp->t_state > TCPS_CLOSED);
@@ -898,8 +893,6 @@ tcp_timer_enter(void *xtp)
 		}
 		INP_WUNLOCK(inp);
 	}
-
-	curthread->td_pflags &= ~TDP_INTCPCALLOUT;
 }
 
 /*
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 1e98cc84a60a..466fb3c0cd41 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -560,7 +560,7 @@ enum {
 #define	TDP_RESETSPUR	0x04000000 /* Reset spurious page fault history. */
 #define	TDP_NERRNO	0x08000000 /* Last errno is already in td_errno */
 #define	TDP_UIOHELD	0x10000000 /* Current uio has pages held in td_ma */
-#define	TDP_INTCPCALLOUT 0x20000000 /* used by netinet/tcp_timer.c */
+#define	TDP_UNUSED0	0x20000000 /* UNUSED */
 #define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
 #define	TDP_SIGFASTPENDING 0x80000000 /* Pending signal due to sigfastblock */