diff options
| author | David Greenman <dg@FreeBSD.org> | 1994-11-13 12:47:07 +0000 |
|---|---|---|
| committer | David Greenman <dg@FreeBSD.org> | 1994-11-13 12:47:07 +0000 |
| commit | bfbfac11c97e8022649220964a11ff02a9bdb073 (patch) | |
| tree | 1fa246af31b3180408a5a6eaba95e77b80ac8956 | |
| parent | 0d15e0ac1e28e9bb904a0a6f421ac430dd07764a (diff) | |
Notes
| -rw-r--r-- | sys/vm/vm_glue.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index e709dcfcbabb..d35ec701132c 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -59,7 +59,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_glue.c,v 1.7 1994/09/12 15:06:12 davidg Exp $ + * $Id: vm_glue.c,v 1.8 1994/10/09 01:52:08 phk Exp $ */ #include <sys/param.h> @@ -397,7 +397,7 @@ loop1: pp = NULL; ppri = INT_MIN; for (p = (struct proc *)allproc; p != NULL; p = p->p_next) { - if (p->p_stat == SRUN && (p->p_flag & P_INMEM) == 0) { + if (p->p_stat == SRUN && (p->p_flag & (P_INMEM|P_SWAPPING)) == 0) { int mempri; pri = p->p_swtime + p->p_slptime - p->p_nice * 8; mempri = pri > 0 ? pri : 0; @@ -461,7 +461,7 @@ loop1: #define swappable(p) \ (((p)->p_lock == 0) && \ - ((p)->p_flag & (P_TRACED|P_NOSWAP|P_SYSTEM|P_INMEM|P_WEXIT|P_PHYSIO)) == P_INMEM) + ((p)->p_flag & (P_TRACED|P_NOSWAP|P_SYSTEM|P_INMEM|P_WEXIT|P_PHYSIO|P_SWAPPING)) == P_INMEM) extern int vm_pageout_free_min; /* @@ -505,6 +505,12 @@ swapout_threads() case SSLEEP: case SSTOP: /* + * do not swapout a realtime process + */ + if (p->p_rtprio.type == RTP_PRIO_REALTIME) + continue; + + /* * do not swapout a process that is waiting for VM datastructures * there is a possible deadlock. */ @@ -590,7 +596,7 @@ swapout(p) remrq(p); (void) spl0(); - ++p->p_lock; + p->p_flag |= P_SWAPPING; /* let the upages be paged */ pmap_remove(vm_map_pmap(kernel_map), (vm_offset_t) p->p_addr, ((vm_offset_t) p->p_addr) + UPAGES * NBPG); @@ -598,7 +604,7 @@ swapout(p) vm_map_pageable(map, (vm_offset_t) kstack, (vm_offset_t) kstack + UPAGES * NBPG, TRUE); - --p->p_lock; + p->p_flag &= ~P_SWAPPING; p->p_swtime = 0; } |
