diff options
author | jeff <jeff@FreeBSD.org> | 2007-09-17 05:31:39 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-09-17 05:31:39 +0000 |
commit | 3fc0f8b973fdc2f392a3234d653e09d71e2aab98 (patch) | |
tree | e572a7b77f24339d2dc6ebf6b83c1e2c1ce0f6a5 /sys/kern/kern_proc.c | |
parent | 74666fdfce0e06484d5f82e8fced0c16c06477d1 (diff) | |
download | FreeBSD-src-3fc0f8b973fdc2f392a3234d653e09d71e2aab98.zip FreeBSD-src-3fc0f8b973fdc2f392a3234d653e09d71e2aab98.tar.gz |
- Move all of the PS_ flags into either p_flag or td_flags.
- p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or
previously the sched_lock. These bugs have existed for some time.
- Allow swapout to try each thread in a process individually and then
swapin the whole process if any of these fail. This allows us to move
most scheduler related swap flags into td_flags.
- Keep ki_sflag for backwards compat but change all in source tools to
use the new and more correct location of P_INMEM.
Reported by: pho
Reviewed by: attilio, kib
Approved by: re (kensmith)
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r-- | sys/kern/kern_proc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f9f993d..bec9ee3 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -690,14 +690,17 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) kp->ki_ssize = vm->vm_ssize; } else if (p->p_state == PRS_ZOMBIE) kp->ki_stat = SZOMB; - kp->ki_sflag = p->p_sflag; + if (kp->ki_flag & P_INMEM) + kp->ki_sflag = PS_INMEM; + else + kp->ki_sflag = 0; kp->ki_swtime = p->p_swtime; kp->ki_pid = p->p_pid; kp->ki_nice = p->p_nice; rufetch(p, &kp->ki_rusage); kp->ki_runtime = cputick2usec(p->p_rux.rux_runtime); PROC_SUNLOCK(p); - if ((p->p_sflag & PS_INMEM) && p->p_stats != NULL) { + if ((p->p_flag & P_INMEM) && p->p_stats != NULL) { kp->ki_start = p->p_stats->p_start; timevaladd(&kp->ki_start, &boottime); PROC_SLOCK(p); |