Move fork_rfppwait() check into ast()
This will always sleep at least once, so it's a slow path by definition. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D33387
This commit is contained in:
parent
8cfd7a6aeb
commit
626d6992ca
@ -484,6 +484,12 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
|
||||
*/
|
||||
thread_lock(td);
|
||||
sched_fork(td, td2);
|
||||
/*
|
||||
* Request AST to check for TDP_RFPPWAIT. Do it here
|
||||
* to avoid calling thread_lock() again.
|
||||
*/
|
||||
if ((fr->fr_flags & RFPPWAIT) != 0)
|
||||
td->td_flags |= TDF_ASTPENDING;
|
||||
thread_unlock(td);
|
||||
|
||||
/*
|
||||
|
@ -285,7 +285,4 @@ syscallret(struct thread *td)
|
||||
td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK);
|
||||
PROC_UNLOCK(p);
|
||||
}
|
||||
|
||||
if (__predict_false(td->td_pflags & TDP_RFPPWAIT))
|
||||
fork_rfppwait(td);
|
||||
}
|
||||
|
@ -259,6 +259,8 @@ ast(struct trapframe *framep)
|
||||
if (PMC_IS_PENDING_CALLCHAIN(td))
|
||||
PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_USER_CALLCHAIN_SOFT, (void *) framep);
|
||||
#endif
|
||||
if ((td->td_pflags & TDP_RFPPWAIT) != 0)
|
||||
fork_rfppwait(td);
|
||||
if (flags & TDF_ALRMPEND) {
|
||||
PROC_LOCK(p);
|
||||
kern_psignal(p, SIGVTALRM);
|
||||
|
Loading…
Reference in New Issue
Block a user