diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-22 20:00:26 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-22 20:00:26 +0000 |
commit | 82ad2123a7b313d71d0658f06af9b38db418b946 (patch) | |
tree | e7253a8991f553e9eb629a4f9920de499543b07d /sys/fs/procfs | |
parent | 3cd76cb1f7232072da9de75f0c43d9b30c28d8d0 (diff) | |
download | FreeBSD-src-82ad2123a7b313d71d0658f06af9b38db418b946.zip FreeBSD-src-82ad2123a7b313d71d0658f06af9b38db418b946.tar.gz |
- Always call faultin() in _PHOLD() if PS_INMEM is clear. This closes a
race where a thread could assume that a process was swapped in by
PHOLD() when it actually wasn't fully swapped in yet.
- In faultin(), always msleep() if PS_SWAPPINGIN is set instead of doing
this check after bumping p_lock in the PS_INMEM == 0 case. Also,
sched_lock is only needed for setting and clearning swapping PS_*
flags and the swap thread inhibitor.
- Don't set and clear the thread swap inhibitor in the same loops as the
pmap_swapin/out_thread() since we have to do it under sched_lock.
Instead, mimic the treatment of the PS_INMEM flag and use separate loops
to set the inhibitors when clearing PS_INMEM and clear the inhibitors
when setting PS_INMEM.
- swapout() now returns with the proc lock held as it holds the lock
while adjusting the swapping-related PS_* flags so that the proc lock
can be used to test those flags.
- Only use the proc lock to check the swapping-related PS_* flags in
several places.
- faultin() no longer requires sched_lock to be held by callers.
- Rename PS_SWAPPING to PS_SWAPPINGOUT to be less ambiguous now that we
have PS_SWAPPINGIN.
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r-- | sys/fs/procfs/procfs_ctl.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c index ff4fb0a..ecc8321 100644 --- a/sys/fs/procfs/procfs_ctl.c +++ b/sys/fs/procfs/procfs_ctl.c @@ -144,9 +144,7 @@ procfs_control(struct thread *td, struct proc *p, int op) * Stop the target. */ p->p_flag |= P_TRACED; - mtx_lock_spin(&sched_lock); faultin(p); - mtx_unlock_spin(&sched_lock); p->p_xstat = 0; /* XXX ? */ if (p->p_pptr != td->td_proc) { p->p_oppid = p->p_pptr->p_pid; |