Remove inappropriate VOP_FSYNC from vm_object_page_clean(). The fsync

syncs the entire underlying file rather then just the requested range,
    resulting in huge inefficiencies when the VM system is articulated in
    a certain way.  The VOP_FSYNC was also found to massively reduce NFS
    performance in certain cases.

    Change MADV_DONTNEED and MADV_FREE to call vm_page_dontneed() instead
    of vm_page_deactivate().  Using vm_page_deactivate() causes all
    inactive and cache pages to be recycled before the dontneed/free page
    is recycled, effectively flushing our entire VM inactive & cache
    queues continuously even if only a few pages are being actively MADV
    free'd and reused (such as occurs with a sequential scan of a
    memory-mapped file).

Reviewed by:	Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com>
This commit is contained in:
Matthew Dillon 1999-09-17 05:48:36 +00:00
parent 3f873b513b
commit 479112dfd9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51343

View File

@ -641,7 +641,9 @@ vm_object_page_clean(object, start, end, flags)
goto rescan;
}
#if 0
VOP_FSYNC(vp, NULL, (pagerflags & VM_PAGER_PUT_SYNC)?MNT_WAIT:0, curproc);
#endif
vm_object_clear_flag(object, OBJ_CLEANING);
return;
@ -826,7 +828,7 @@ vm_object_madvise(object, pindex, count, advise)
if (advise == MADV_WILLNEED) {
vm_page_activate(m);
} else if (advise == MADV_DONTNEED) {
vm_page_deactivate(m);
vm_page_dontneed(m);
} else if (advise == MADV_FREE) {
/*
* Mark the page clean. This will allow the page
@ -846,7 +848,7 @@ vm_object_madvise(object, pindex, count, advise)
pmap_clear_modify(VM_PAGE_TO_PHYS(m));
m->dirty = 0;
m->act_count = 0;
vm_page_deactivate(m);
vm_page_dontneed(m);
if (tobject->type == OBJT_SWAP)
swap_pager_freespace(tobject, tpindex, 1);
}