vm_pageout.c (84933) | vm_pageout.c (85272) |
---|---|
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 84933 2001-10-14 20:51:14Z tegge $ | 68 * $FreeBSD: head/sys/vm/vm_pageout.c 85272 2001-10-21 06:12:06Z dillon $ |
69 */ 70 71/* 72 * The proverbial page-out daemon. 73 */ 74 75#include "opt_vm.h" 76#include <sys/param.h> --- 212 unchanged lines hidden (view full) --- 289 if (((p->queue - p->pc) == PQ_CACHE) || 290 (p->flags & (PG_BUSY|PG_UNMANAGED)) || p->busy) { 291 ib = 0; 292 break; 293 } 294 vm_page_test_dirty(p); 295 if ((p->dirty & p->valid) == 0 || 296 p->queue != PQ_INACTIVE || | 69 */ 70 71/* 72 * The proverbial page-out daemon. 73 */ 74 75#include "opt_vm.h" 76#include <sys/param.h> --- 212 unchanged lines hidden (view full) --- 289 if (((p->queue - p->pc) == PQ_CACHE) || 290 (p->flags & (PG_BUSY|PG_UNMANAGED)) || p->busy) { 291 ib = 0; 292 break; 293 } 294 vm_page_test_dirty(p); 295 if ((p->dirty & p->valid) == 0 || 296 p->queue != PQ_INACTIVE || |
297 p->wire_count != 0 || 298 p->hold_count != 0) { | 297 p->wire_count != 0 || /* may be held by buf cache */ 298 p->hold_count != 0) { /* may be undergoing I/O */ |
299 ib = 0; 300 break; 301 } 302 mc[--page_base] = p; 303 ++pageout_count; 304 ++ib; 305 /* 306 * alignment boundry, stop here and switch directions. Do --- 11 unchanged lines hidden (view full) --- 318 break; 319 if (((p->queue - p->pc) == PQ_CACHE) || 320 (p->flags & (PG_BUSY|PG_UNMANAGED)) || p->busy) { 321 break; 322 } 323 vm_page_test_dirty(p); 324 if ((p->dirty & p->valid) == 0 || 325 p->queue != PQ_INACTIVE || | 299 ib = 0; 300 break; 301 } 302 mc[--page_base] = p; 303 ++pageout_count; 304 ++ib; 305 /* 306 * alignment boundry, stop here and switch directions. Do --- 11 unchanged lines hidden (view full) --- 318 break; 319 if (((p->queue - p->pc) == PQ_CACHE) || 320 (p->flags & (PG_BUSY|PG_UNMANAGED)) || p->busy) { 321 break; 322 } 323 vm_page_test_dirty(p); 324 if ((p->dirty & p->valid) == 0 || 325 p->queue != PQ_INACTIVE || |
326 p->wire_count != 0 || 327 p->hold_count != 0) { | 326 p->wire_count != 0 || /* may be held by buf cache */ 327 p->hold_count != 0) { /* may be undergoing I/O */ |
328 break; 329 } 330 mc[page_base + pageout_count] = p; 331 ++pageout_count; 332 ++is; 333 } 334 335 /* --- 373 unchanged lines hidden (view full) --- 709 next = TAILQ_NEXT(m, pageq); 710 711 /* 712 * skip marker pages 713 */ 714 if (m->flags & PG_MARKER) 715 continue; 716 | 328 break; 329 } 330 mc[page_base + pageout_count] = p; 331 ++pageout_count; 332 ++is; 333 } 334 335 /* --- 373 unchanged lines hidden (view full) --- 709 next = TAILQ_NEXT(m, pageq); 710 711 /* 712 * skip marker pages 713 */ 714 if (m->flags & PG_MARKER) 715 continue; 716 |
717 /* 718 * A held page may be undergoing I/O, so skip it. 719 */ |
|
717 if (m->hold_count) { 718 vm_pageq_requeue(m); 719 addl_page_shortage++; 720 continue; 721 } 722 /* 723 * Dont mess with busy pages, keep in the front of the 724 * queue, most likely are being paged out. --- 174 unchanged lines hidden (view full) --- 899 */ 900 if (m->busy || (m->flags & PG_BUSY)) { 901 vput(vp); 902 vn_finished_write(mp); 903 continue; 904 } 905 906 /* | 720 if (m->hold_count) { 721 vm_pageq_requeue(m); 722 addl_page_shortage++; 723 continue; 724 } 725 /* 726 * Dont mess with busy pages, keep in the front of the 727 * queue, most likely are being paged out. --- 174 unchanged lines hidden (view full) --- 902 */ 903 if (m->busy || (m->flags & PG_BUSY)) { 904 vput(vp); 905 vn_finished_write(mp); 906 continue; 907 } 908 909 /* |
907 * If the page has become held, then skip it | 910 * If the page has become held it might 911 * be undergoing I/O, so skip it |
908 */ 909 if (m->hold_count) { 910 vm_pageq_requeue(m); 911 if (object->flags & OBJ_MIGHTBEDIRTY) 912 vnodes_skipped++; 913 vput(vp); 914 vn_finished_write(mp); 915 continue; --- 596 unchanged lines hidden --- | 912 */ 913 if (m->hold_count) { 914 vm_pageq_requeue(m); 915 if (object->flags & OBJ_MIGHTBEDIRTY) 916 vnodes_skipped++; 917 vput(vp); 918 vn_finished_write(mp); 919 continue; --- 596 unchanged lines hidden --- |