Move TDP_GEOM check from userret() to ast(); this code path is quite

infrequent.

Reviewed by:	kib
No objections:	mav
Tested by:	pho
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26374
This commit is contained in:
Edward Tomasz Napierala 2020-09-14 10:14:03 +00:00
parent 30d158eecc
commit 60f083efe2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365711
2 changed files with 10 additions and 7 deletions

View File

@ -374,6 +374,9 @@ g_post_event_x(g_event_t *func, void *arg, int flag, int wuflag, struct g_event
if (epp != NULL)
*epp = ep;
curthread->td_pflags |= TDP_GEOM;
thread_lock(curthread);
curthread->td_flags |= TDF_ASTPENDING;
thread_unlock(curthread);
return (0);
}

View File

@ -137,13 +137,6 @@ userret(struct thread *td, struct trapframe *frame)
td_softdep_cleanup(td);
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.
*/
@ -286,6 +279,13 @@ ast(struct trapframe *framep)
#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) {
PROC_LOCK(p);