]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- Always call faultin() in _PHOLD() if PS_INMEM is clear. This closes a
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Apr 2003 20:00:26 +0000 (20:00 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Apr 2003 20:00:26 +0000 (20:00 +0000)
commit664f718ba1d4f11463ef6ee07ec717977c209510
treee7253a8991f553e9eb629a4f9920de499543b07d
parentc0bb08c5edc2f2131ecd6b141e204c42be368cce
- 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.
sys/fs/procfs/procfs_ctl.c
sys/sys/proc.h
sys/vm/vm_glue.c