diff options
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 33f9d67..d9cd47f 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -631,6 +631,9 @@ vm_object_terminate(vm_object_t object) * write out pages with PG_NOSYNC set (originally comes from MAP_NOSYNC), * leaving the object dirty. * + * When stuffing pages asynchronously, allow clustering. XXX we need a + * synchronous clustering mode implementation. + * * Odd semantics: if start == end, we clean everything. * * The object must be locked. @@ -652,7 +655,7 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int (object->flags & OBJ_MIGHTBEDIRTY) == 0) return; - pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) ? VM_PAGER_PUT_SYNC : 0; + pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) ? VM_PAGER_PUT_SYNC : VM_PAGER_CLUSTER_OK; pagerflags |= (flags & OBJPC_INVAL) ? VM_PAGER_PUT_INVAL : 0; vp = object->handle; @@ -682,6 +685,7 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int scanreset = object->resident_page_count / EASY_SCAN_FACTOR; if (scanreset < 16) scanreset = 16; + pagerflags |= VM_PAGER_IGNORE_CLEANCHK; scanlimit = scanreset; tscan = tstart; @@ -732,6 +736,7 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int vm_object_clear_flag(object, OBJ_CLEANING); return; } + pagerflags &= ~VM_PAGER_IGNORE_CLEANCHK; } /* @@ -854,7 +859,8 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, if ((tp = vm_page_lookup(object, pi + i)) != NULL) { if ((tp->flags & PG_BUSY) || - (tp->flags & PG_CLEANCHK) == 0 || + ((pagerflags & VM_PAGER_IGNORE_CLEANCHK) == 0 && + (tp->flags & PG_CLEANCHK) == 0) || (tp->busy != 0)) break; if((tp->queue - tp->pc) == PQ_CACHE) { @@ -881,7 +887,8 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, if ((tp = vm_page_lookup(object, pi - i)) != NULL) { if ((tp->flags & PG_BUSY) || - (tp->flags & PG_CLEANCHK) == 0 || + ((pagerflags & VM_PAGER_IGNORE_CLEANCHK) == 0 && + (tp->flags & PG_CLEANCHK) == 0) || (tp->busy != 0)) break; if ((tp->queue - tp->pc) == PQ_CACHE) { |