Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_epoch.c
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | #ifdef INVARIANTS | ||||
locks = curthread->td_locks; | locks = curthread->td_locks; | ||||
MPASS(epoch->e_flags & EPOCH_PREEMPT); | MPASS(epoch->e_flags & EPOCH_PREEMPT); | ||||
if ((epoch->e_flags & EPOCH_LOCKED) == 0) | if ((epoch->e_flags & EPOCH_LOCKED) == 0) | ||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | ||||
"epoch_wait() can be long running"); | "epoch_wait() can be long running"); | ||||
KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle " | KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle " | ||||
"of an epoch section of the same epoch")); | "of an epoch section of the same epoch")); | ||||
#endif | #endif | ||||
thread_lock(td); | |||||
DROP_GIANT(); | DROP_GIANT(); | ||||
thread_lock(td); | |||||
old_cpu = PCPU_GET(cpuid); | old_cpu = PCPU_GET(cpuid); | ||||
old_pinned = td->td_pinned; | old_pinned = td->td_pinned; | ||||
old_prio = td->td_priority; | old_prio = td->td_priority; | ||||
was_bound = sched_is_bound(td); | was_bound = sched_is_bound(td); | ||||
sched_unbind(td); | sched_unbind(td); | ||||
td->td_pinned = 0; | td->td_pinned = 0; | ||||
sched_bind(td, old_cpu); | sched_bind(td, old_cpu); | ||||
▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines |