For md(4), posix shm(3) and tmpfs(5), free swap space used by paged in

dirty page, which is written by the process.

Reviewed by:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2014-07-28 14:27:05 +00:00
parent fe0e9a63e0
commit 5d9b4508fd
2 changed files with 4 additions and 1 deletions

View File

@ -895,8 +895,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
else
vm_page_activate(m);
vm_page_unlock(m);
if (bp->bio_cmd == BIO_WRITE)
if (bp->bio_cmd == BIO_WRITE) {
vm_page_dirty(m);
vm_pager_page_unswapped(m);
}
/* Actions on further pages start at offset 0 */
p += PAGE_SIZE - offs;

View File

@ -199,6 +199,7 @@ uiomove_object_page(vm_object_t obj, size_t len, struct uio *uio)
if (uio->uio_rw == UIO_WRITE && error == 0) {
VM_OBJECT_WLOCK(obj);
vm_page_dirty(m);
vm_pager_page_unswapped(m);
VM_OBJECT_WUNLOCK(obj);
}
vm_page_lock(m);