Deleted Added
full compact
vm_pageout.c (61058) vm_pageout.c (61081)
1/*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 * Copyright (c) 1994 John S. Dyson
5 * All rights reserved.
6 * Copyright (c) 1994 David Greenman
7 * All rights reserved.
8 *

--- 51 unchanged lines hidden (view full) ---

60 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
61 * School of Computer Science
62 * Carnegie Mellon University
63 * Pittsburgh PA 15213-3890
64 *
65 * any improvements or extensions that they make and grant Carnegie the
66 * rights to redistribute these changes.
67 *
1/*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 * Copyright (c) 1994 John S. Dyson
5 * All rights reserved.
6 * Copyright (c) 1994 David Greenman
7 * All rights reserved.
8 *

--- 51 unchanged lines hidden (view full) ---

60 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
61 * School of Computer Science
62 * Carnegie Mellon University
63 * Pittsburgh PA 15213-3890
64 *
65 * any improvements or extensions that they make and grant Carnegie the
66 * rights to redistribute these changes.
67 *
68 * $FreeBSD: head/sys/vm/vm_pageout.c 61058 2000-05-29 02:31:55Z dillon $
68 * $FreeBSD: head/sys/vm/vm_pageout.c 61081 2000-05-29 22:40:54Z dillon $
69 */
70
71/*
72 * The proverbial page-out daemon.
73 */
74
75#include "opt_vm.h"
76#include <sys/param.h>

--- 151 unchanged lines hidden (view full) ---

228 * with the new swapper, but we could have serious problems paging
229 * out other object types if there is insufficient memory.
230 *
231 * Unfortunately, checking free memory here is far too late, so the
232 * check has been moved up a procedural level.
233 */
234
235 /*
69 */
70
71/*
72 * The proverbial page-out daemon.
73 */
74
75#include "opt_vm.h"
76#include <sys/param.h>

--- 151 unchanged lines hidden (view full) ---

228 * with the new swapper, but we could have serious problems paging
229 * out other object types if there is insufficient memory.
230 *
231 * Unfortunately, checking free memory here is far too late, so the
232 * check has been moved up a procedural level.
233 */
234
235 /*
236 * Don't mess with the page if it's busy.
236 * Don't mess with the page if it's busy, held, or special
237 */
238 if ((m->hold_count != 0) ||
237 */
238 if ((m->hold_count != 0) ||
239 ((m->busy != 0) || (m->flags & PG_BUSY)))
239 ((m->busy != 0) || (m->flags & (PG_BUSY|PG_UNMANAGED)))) {
240 return 0;
240 return 0;
241 }
241
242 mc[vm_pageout_page_count] = m;
243 pageout_count = 1;
244 page_base = vm_pageout_page_count;
245 ib = 1;
246 is = 1;
247
248 /*

--- 25 unchanged lines hidden (view full) ---

274 break;
275 }
276
277 if ((p = vm_page_lookup(object, pindex - ib)) == NULL) {
278 ib = 0;
279 break;
280 }
281 if (((p->queue - p->pc) == PQ_CACHE) ||
242
243 mc[vm_pageout_page_count] = m;
244 pageout_count = 1;
245 page_base = vm_pageout_page_count;
246 ib = 1;
247 is = 1;
248
249 /*

--- 25 unchanged lines hidden (view full) ---

275 break;
276 }
277
278 if ((p = vm_page_lookup(object, pindex - ib)) == NULL) {
279 ib = 0;
280 break;
281 }
282 if (((p->queue - p->pc) == PQ_CACHE) ||
282 (p->flags & PG_BUSY) || p->busy) {
283 (p->flags & (PG_BUSY|PG_UNMANAGED)) || p->busy) {
283 ib = 0;
284 break;
285 }
286 vm_page_test_dirty(p);
287 if ((p->dirty & p->valid) == 0 ||
288 p->queue != PQ_INACTIVE ||
289 p->wire_count != 0 ||
290 p->hold_count != 0) {

--- 13 unchanged lines hidden (view full) ---

304
305 while (pageout_count < vm_pageout_page_count &&
306 pindex + is < object->size) {
307 vm_page_t p;
308
309 if ((p = vm_page_lookup(object, pindex + is)) == NULL)
310 break;
311 if (((p->queue - p->pc) == PQ_CACHE) ||
284 ib = 0;
285 break;
286 }
287 vm_page_test_dirty(p);
288 if ((p->dirty & p->valid) == 0 ||
289 p->queue != PQ_INACTIVE ||
290 p->wire_count != 0 ||
291 p->hold_count != 0) {

--- 13 unchanged lines hidden (view full) ---

305
306 while (pageout_count < vm_pageout_page_count &&
307 pindex + is < object->size) {
308 vm_page_t p;
309
310 if ((p = vm_page_lookup(object, pindex + is)) == NULL)
311 break;
312 if (((p->queue - p->pc) == PQ_CACHE) ||
312 (p->flags & PG_BUSY) || p->busy) {
313 (p->flags & (PG_BUSY|PG_UNMANAGED)) || p->busy) {
313 break;
314 }
315 vm_page_test_dirty(p);
316 if ((p->dirty & p->valid) == 0 ||
317 p->queue != PQ_INACTIVE ||
318 p->wire_count != 0 ||
319 p->hold_count != 0) {
320 break;

--- 148 unchanged lines hidden (view full) ---

469 int actcount;
470 if (pmap_resident_count(vm_map_pmap(map)) <= desired)
471 return;
472 next = TAILQ_NEXT(p, listq);
473 cnt.v_pdpages++;
474 if (p->wire_count != 0 ||
475 p->hold_count != 0 ||
476 p->busy != 0 ||
314 break;
315 }
316 vm_page_test_dirty(p);
317 if ((p->dirty & p->valid) == 0 ||
318 p->queue != PQ_INACTIVE ||
319 p->wire_count != 0 ||
320 p->hold_count != 0) {
321 break;

--- 148 unchanged lines hidden (view full) ---

470 int actcount;
471 if (pmap_resident_count(vm_map_pmap(map)) <= desired)
472 return;
473 next = TAILQ_NEXT(p, listq);
474 cnt.v_pdpages++;
475 if (p->wire_count != 0 ||
476 p->hold_count != 0 ||
477 p->busy != 0 ||
477 (p->flags & PG_BUSY) ||
478 (p->flags & (PG_BUSY|PG_UNMANAGED)) ||
478 !pmap_page_exists(vm_map_pmap(map), p)) {
479 p = next;
480 continue;
481 }
482
483 actcount = pmap_ts_referenced(p);
484 if (actcount) {
485 vm_page_flag_set(p, PG_REFERENCED);

--- 556 unchanged lines hidden (view full) ---

1042 * does not effect other calculations.
1043 */
1044
1045 while (cnt.v_free_count < cnt.v_free_reserved) {
1046 static int cache_rover = 0;
1047 m = vm_page_list_find(PQ_CACHE, cache_rover, FALSE);
1048 if (!m)
1049 break;
479 !pmap_page_exists(vm_map_pmap(map), p)) {
480 p = next;
481 continue;
482 }
483
484 actcount = pmap_ts_referenced(p);
485 if (actcount) {
486 vm_page_flag_set(p, PG_REFERENCED);

--- 556 unchanged lines hidden (view full) ---

1043 * does not effect other calculations.
1044 */
1045
1046 while (cnt.v_free_count < cnt.v_free_reserved) {
1047 static int cache_rover = 0;
1048 m = vm_page_list_find(PQ_CACHE, cache_rover, FALSE);
1049 if (!m)
1050 break;
1050 if ((m->flags & PG_BUSY) || m->busy || m->hold_count || m->wire_count) {
1051 if ((m->flags & (PG_BUSY|PG_UNMANAGED)) ||
1052 m->busy ||
1053 m->hold_count ||
1054 m->wire_count) {
1051#ifdef INVARIANTS
1052 printf("Warning: busy page %p found in cache\n", m);
1053#endif
1054 vm_page_deactivate(m);
1055 continue;
1056 }
1057 cache_rover = (cache_rover + PQ_PRIME2) & PQ_L2_MASK;
1058 vm_pageout_page_free(m);

--- 381 unchanged lines hidden ---
1055#ifdef INVARIANTS
1056 printf("Warning: busy page %p found in cache\n", m);
1057#endif
1058 vm_page_deactivate(m);
1059 continue;
1060 }
1061 cache_rover = (cache_rover + PQ_PRIME2) & PQ_L2_MASK;
1062 vm_pageout_page_free(m);

--- 381 unchanged lines hidden ---