Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_thread.c
Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | #endif | ||||
/* Do the same timestamp bookkeeping that mi_switch() would do. */ | /* Do the same timestamp bookkeeping that mi_switch() would do. */ | ||||
new_switchtime = cpu_ticks(); | new_switchtime = cpu_ticks(); | ||||
runtime = new_switchtime - PCPU_GET(switchtime); | runtime = new_switchtime - PCPU_GET(switchtime); | ||||
td->td_runtime += runtime; | td->td_runtime += runtime; | ||||
td->td_incruntime += runtime; | td->td_incruntime += runtime; | ||||
PCPU_SET(switchtime, new_switchtime); | PCPU_SET(switchtime, new_switchtime); | ||||
PCPU_SET(switchticks, ticks); | PCPU_SET(switchticks, ticks); | ||||
PCPU_INC(cnt.v_swtch); | VM_CNT_INC(v_swtch); | ||||
/* Save our resource usage in our process. */ | /* Save our resource usage in our process. */ | ||||
td->td_ru.ru_nvcsw++; | td->td_ru.ru_nvcsw++; | ||||
ruxagg(p, td); | ruxagg(p, td); | ||||
rucollect(&p->p_ru, &td->td_ru); | rucollect(&p->p_ru, &td->td_ru); | ||||
PROC_STATUNLOCK(p); | PROC_STATUNLOCK(p); | ||||
td->td_state = TDS_INACTIVE; | td->td_state = TDS_INACTIVE; | ||||
▲ Show 20 Lines • Show All 652 Lines • Show Last 20 Lines |