Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_trap.c
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | "failed to set signal flags for ast p %p td %p fl %x", | ||||
thread_unlock(td); | thread_unlock(td); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef KTRACE | #ifdef KTRACE | ||||
KTRUSERRET(td); | KTRUSERRET(td); | ||||
#endif | #endif | ||||
td_softdep_cleanup(td); | |||||
MPASS(td->td_su == NULL); | |||||
/* | /* | ||||
* Charge system time if profiling. | * Charge system time if profiling. | ||||
*/ | */ | ||||
if (__predict_false(p->p_flag & P_PROFIL)) | if (__predict_false(p->p_flag & P_PROFIL)) | ||||
addupc_task(td, TRAPF_PC(frame), td->td_pticks * psratio); | addupc_task(td, TRAPF_PC(frame), td->td_pticks * psratio); | ||||
#ifdef HWPMC_HOOKS | #ifdef HWPMC_HOOKS | ||||
if (PMC_THREAD_HAS_SAMPLES(td)) | if (PMC_THREAD_HAS_SAMPLES(td)) | ||||
Show All 35 Lines | #endif | ||||
KASSERT(0, ("userret: Returning with sleep disabled")); | KASSERT(0, ("userret: Returning with sleep disabled")); | ||||
} | } | ||||
KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, | KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, | ||||
("userret: Returning with with pinned thread")); | ("userret: Returning with with pinned thread")); | ||||
KASSERT(td->td_vp_reserved == NULL, | KASSERT(td->td_vp_reserved == NULL, | ||||
("userret: Returning with preallocated vnode")); | ("userret: Returning with preallocated vnode")); | ||||
KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0, | KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0, | ||||
("userret: Returning with stop signals deferred")); | ("userret: Returning with stop signals deferred")); | ||||
KASSERT(td->td_su == NULL, | |||||
("userret: Returning with SU cleanup request not handled")); | |||||
KASSERT(td->td_vslock_sz == 0, | KASSERT(td->td_vslock_sz == 0, | ||||
("userret: Returning with vslock-wired space")); | ("userret: Returning with vslock-wired space")); | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ | /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ | ||||
VNET_ASSERT(curvnet == NULL, | VNET_ASSERT(curvnet == NULL, | ||||
("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s", | ("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s", | ||||
__func__, td, p->p_pid, td->td_name, curvnet, | __func__, td, p->p_pid, td->td_name, curvnet, | ||||
(td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); | (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | #endif | ||||
thread_lock(td); | thread_lock(td); | ||||
sched_prio(td, td->td_user_pri); | sched_prio(td, td->td_user_pri); | ||||
mi_switch(SW_INVOL | SWT_NEEDRESCHED); | mi_switch(SW_INVOL | SWT_NEEDRESCHED); | ||||
#ifdef KTRACE | #ifdef KTRACE | ||||
if (KTRPOINT(td, KTR_CSW)) | if (KTRPOINT(td, KTR_CSW)) | ||||
ktrcsw(0, 1, __func__); | ktrcsw(0, 1, __func__); | ||||
#endif | #endif | ||||
} | } | ||||
td_softdep_cleanup(td); | |||||
MPASS(td->td_su == NULL); | |||||
/* | /* | ||||
* If this thread tickled GEOM, we need to wait for the giggling to | * If this thread tickled GEOM, we need to wait for the giggling to | ||||
* stop before we return to userland | * stop before we return to userland | ||||
*/ | */ | ||||
if (__predict_false(td->td_pflags & TDP_GEOM)) | if (__predict_false(td->td_pflags & TDP_GEOM)) | ||||
g_waitidle(); | g_waitidle(); | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |