Index: head/sys/geom/geom_event.c =================================================================== --- head/sys/geom/geom_event.c +++ head/sys/geom/geom_event.c @@ -374,6 +374,9 @@ if (epp != NULL) *epp = ep; curthread->td_pflags |= TDP_GEOM; + thread_lock(curthread); + curthread->td_flags |= TDF_ASTPENDING; + thread_unlock(curthread); return (0); } Index: head/sys/kern/subr_trap.c =================================================================== --- head/sys/kern/subr_trap.c +++ head/sys/kern/subr_trap.c @@ -138,13 +138,6 @@ MPASS(td->td_su == NULL); /* - * If this thread tickled GEOM, we need to wait for the giggling to - * stop before we return to userland - */ - if (__predict_false(td->td_pflags & TDP_GEOM)) - g_waitidle(); - - /* * Charge system time if profiling. */ if (__predict_false(p->p_flag & P_PROFIL)) @@ -285,6 +278,13 @@ ktrcsw(0, 1, __func__); #endif } + + /* + * If this thread tickled GEOM, we need to wait for the giggling to + * stop before we return to userland + */ + if (__predict_false(td->td_pflags & TDP_GEOM)) + g_waitidle(); #ifdef DIAGNOSTIC if (p->p_numthreads == 1 && (flags & TDF_NEEDSIGCHK) == 0) {