Turn P_NOSWAP and P_PHYSIO into a hold count, as suggested by a comment.

This commit is contained in:
mycroft 1994-06-15 19:59:21 +00:00
parent a53fa907c7
commit 0d8affb278
5 changed files with 9 additions and 9 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
* $Id: kern_fork.c,v 1.17 1994/05/19 05:57:48 cgd Exp $
* $Id: kern_fork.c,v 1.18 1994/06/15 19:59:21 mycroft Exp $
*/
#include <sys/param.h>
@ -259,7 +259,7 @@ again:
* This begins the section where we must prevent the parent
* from being swapped.
*/
p1->p_flag |= P_NOSWAP;
p1->p_holdcnt++;
/*
* Set return values for child before vm_fork,
* so they can be copied to child stack.
@ -292,7 +292,7 @@ again:
/*
* Now can be swapped.
*/
p1->p_flag &= ~P_NOSWAP;
p1->p_holdcnt--;
/*
* Preserve synchronization semantics of vfork. If waiting for

View File

@ -1 +1 @@
revision 1.15 intentionally removed
revision 1.16 intentionally removed

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94
* $Id: nfs_bio.c,v 1.12 1994/06/08 11:36:51 mycroft Exp $
* $Id: nfs_bio.c,v 1.13 1994/06/15 19:59:52 mycroft Exp $
*/
#include <sys/param.h>
@ -726,7 +726,7 @@ nfs_doio(bp, cr, p)
np->n_mtime != np->n_vattr.va_mtime.ts_sec))) {
uprintf("Process killed due to text file modification\n");
psignal(p, SIGKILL);
p->p_flag |= P_NOSWAP;
p->p_holdcnt++;
}
break;
case VLNK:

View File

@ -1 +1 @@
revision 1.26 intentionally removed
revision 1.27 intentionally removed

View File

@ -409,8 +409,8 @@ noswap:
}
#define swappable(p) \
(((p)->p_flag & \
(P_SYSTEM | P_INMEM | P_NOSWAP | P_WEXIT | P_PHYSIO)) == P_INMEM)
(((p)->p_flag & (P_SYSTEM | P_INMEM | P_WEXIT)) == P_INMEM && \
(p)->p_holdcnt == 0)
/*
* Swapout is driven by the pageout daemon. Very simple, we find eligible