MFp4: Once page is written successfully, we should clear the dirty bits.

This fixes slow operations on mmaped files, because without this fix,
pages were written to disk multiple times.

If one is looking for even greater speed up for such operation, he should
disable ZIL (by setting vfs.zfs.zil_disable to 1 in /boot/loader.conf).
Disabling ZIL makes fsx run ~9 times faster.
This commit is contained in:
Pawel Jakub Dawidek 2007-04-24 16:53:01 +00:00
parent 71ce4c9c10
commit 0cdad5e228
2 changed files with 6 additions and 0 deletions

View File

@ -318,6 +318,9 @@ mappedwrite(vnode_t *vp, int nbytes, uio_t *uio, dmu_tx_t *tx)
sf_buf_free(sf);
sched_unpin();
VM_OBJECT_LOCK(obj);
vm_page_lock_queues();
vm_page_set_validclean(m, off, bytes);
vm_page_unlock_queues();
vm_page_wakeup(m);
} else {
VM_OBJECT_UNLOCK(obj);

View File

@ -318,6 +318,9 @@ mappedwrite(vnode_t *vp, int nbytes, uio_t *uio, dmu_tx_t *tx)
sf_buf_free(sf);
sched_unpin();
VM_OBJECT_LOCK(obj);
vm_page_lock_queues();
vm_page_set_validclean(m, off, bytes);
vm_page_unlock_queues();
vm_page_wakeup(m);
} else {
VM_OBJECT_UNLOCK(obj);