aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-09-08 13:46:08 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-09-09 02:51:08 +0000
commitb0474e14895908f45c64158b0e558236923b8eb2 (patch)
tree8eeda4e87b1ec174b7e793bef168b3d99f27d13e
parentf51d7d5139a76d225c9f537bd948525ababdef0c (diff)
geom: only set TDP_GEOM for user threads
For kernel threads, ASTs are not handled at all, so there is no reason to expect that g_waitidle() would be called through AST scheduling. PR: 289204 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D52421
-rw-r--r--sys/geom/geom_event.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index 341233a6ef47..ffd46db55416 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -347,6 +347,7 @@ static void
g_post_event_ep_va(g_event_t *func, void *arg, int wuflag,
struct g_event *ep, va_list ap)
{
+ struct thread *td;
void *p;
u_int n;
@@ -366,8 +367,12 @@ g_post_event_ep_va(g_event_t *func, void *arg, int wuflag,
TAILQ_INSERT_TAIL(&g_events, ep, events);
mtx_unlock(&g_eventlock);
wakeup(&g_wait_event);
- curthread->td_pflags |= TDP_GEOM;
- ast_sched(curthread, TDA_GEOM);
+
+ td = curthread;
+ if ((td->td_pflags & TDP_KTHREAD) == 0) {
+ td->td_pflags |= TDP_GEOM;
+ ast_sched(td, TDA_GEOM);
+ }
}
void