diff options
author | Alan Cox <alc@FreeBSD.org> | 2017-10-08 16:54:42 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2017-10-08 16:54:42 +0000 |
commit | 37244a84fdbc0e6b44106d0b08b619c2d6c72daf (patch) | |
tree | 8972e02e58ab7068257ec055159f4a8041fce15a /sys/vm | |
parent | 8dd7bf2916adcd89e43380875992d3d3358fa9d5 (diff) | |
download | src-37244a84fdbc0e6b44106d0b08b619c2d6c72daf.tar.gz src-37244a84fdbc0e6b44106d0b08b619c2d6c72daf.zip |
Replace an unnecessary call to vm_page_activate() by an assertion that
the page is already wired or queued. Prior to the elimination of PG_CACHED
pages, vm_page_grab() might have returned a valid, previously PG_CACHED
page, in which case enqueueing the page was necessary. Now, that can't
happen. Moreover, activating the page is a dubious choice, since the page
is not being accessed.
Reviewed by: kib
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=324411
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 8e261d9fbe8a..c8f5b5258522 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1635,9 +1635,12 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t pindex) if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_wakeup(object); vm_page_dirty(m); +#ifdef INVARIANTS vm_page_lock(m); - vm_page_activate(m); + if (m->wire_count == 0 && m->queue == PQ_NONE) + panic("page %p is neither wired nor queued", m); vm_page_unlock(m); +#endif vm_page_xunbusy(m); vm_pager_page_unswapped(m); return; |