Turn P_NOSWAP and P_PHYSIO into a hold count, as suggested by a comment.
This commit is contained in:
parent
a53fa907c7
commit
0d8affb278
@ -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
|
||||
|
@ -1 +1 @@
|
||||
revision 1.15 intentionally removed
|
||||
revision 1.16 intentionally removed
|
||||
|
@ -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:
|
||||
|
@ -1 +1 @@
|
||||
revision 1.26 intentionally removed
|
||||
revision 1.27 intentionally removed
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user