diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2001-02-09 14:59:43 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2001-02-09 14:59:43 +0000 |
| commit | 7ecfc090c0f50591327a2519c9cf1dc33e594aca (patch) | |
| tree | 530d2a118eb1f2ce6cc5bd03ff158ba29d837198 /sys | |
| parent | ec2e32b7fd14f095ce5ce3da34cbcdf53d9830a1 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/kern_idle.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index fdf3566a28f7..e9cb529dac66 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -41,7 +41,9 @@ SYSINIT(idle_setup, SI_SUB_SCHED_IDLE, SI_ORDER_FIRST, idle_setup, NULL) static void idle_proc(void *dummy); /* - * setup per-cpu idle process contexts + * Setup per-cpu idle process contexts. The AP's shouldn't be running or + * accessing their idle processes at this point, so don't bother with + * locking. */ static void idle_setup(void *dummy) @@ -63,6 +65,8 @@ idle_setup(void *dummy) gd->gd_idleproc->p_flag |= P_NOLOAD; gd->gd_idleproc->p_stat = SRUN; + if (gd->gd_curproc == NULL) + gd->gd_curproc = gd->gd_idleproc; } } @@ -106,6 +110,7 @@ idle_proc(void *dummy) } mtx_lock_spin(&sched_lock); + curproc->p_stats->p_ru.ru_nvcsw++; mi_switch(); mtx_unlock_spin(&sched_lock); } |
