svn commit: r255924 - stable/9/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Sat Sep 28 07:43:37 UTC 2013
Author: kib
Date: Sat Sep 28 07:43:36 2013
New Revision: 255924
URL: http://svnweb.freebsd.org/changeset/base/255924
Log:
MFC r255566:
If the last page of the file is partially full and whole valid
portion is invalidated, invalidate the whole page.
Modified:
stable/9/sys/vm/vm_page.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/vm/vm_page.c
==============================================================================
--- stable/9/sys/vm/vm_page.c Sat Sep 28 07:04:03 2013 (r255923)
+++ stable/9/sys/vm/vm_page.c Sat Sep 28 07:43:36 2013 (r255924)
@@ -2637,12 +2637,19 @@ void
vm_page_set_invalid(vm_page_t m, int base, int size)
{
vm_page_bits_t bits;
+ vm_object_t object;
+ object = m->object;
VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
- bits = vm_page_bits(base, size);
+ if (object->type == OBJT_VNODE && base == 0 && IDX_TO_OFF(m->pindex) +
+ size >= object->un_pager.vnp.vnp_size)
+ bits = VM_PAGE_BITS_ALL;
+ else
+ bits = vm_page_bits(base, size);
if (m->valid == VM_PAGE_BITS_ALL && bits != 0)
pmap_remove_all(m);
- KASSERT(!pmap_page_is_mapped(m),
+ KASSERT((bits == 0 && m->valid == VM_PAGE_BITS_ALL) ||
+ !pmap_page_is_mapped(m),
("vm_page_set_invalid: page %p is mapped", m));
m->valid &= ~bits;
m->dirty &= ~bits;
More information about the svn-src-stable-9
mailing list