]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Invalid pages should not appear on the inactive queue. Change the
authorkib <kib@FreeBSD.org>
Wed, 14 Oct 2015 09:03:32 +0000 (09:03 +0000)
committerkib <kib@FreeBSD.org>
Wed, 14 Oct 2015 09:03:32 +0000 (09:03 +0000)
check into an assertion.

Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation

sys/vm/vm_pageout.c

index e0d00f5172f30516a4ed8d03efdbc2f22abb96f7..5611ae66694a066cb7d61875b870233e7bf846a4 100644 (file)
@@ -1174,11 +1174,12 @@ unlock_page:
                queues_locked = FALSE;
 
                /*
-                * Invalid pages can be easily freed. They cannot be
-                * mapped, vm_page_free() asserts this.
+                * Invalid pages cannot appear on a queue.  If
+                * vm_pageout_fallback_object_lock() allowed a window
+                * where the page could be invalidated, it should
+                * detect this.
                 */
-               if (m->valid == 0)
-                       goto free_page;
+               KASSERT(m->valid != 0, ("Invalid page %p on inact queue", m));
 
                /*
                 * If the page has been referenced and the object is not dead,
@@ -1231,7 +1232,6 @@ unlock_page:
                        /*
                         * Clean pages can be freed.
                         */
-free_page:
                        vm_page_free(m);
                        PCPU_INC(cnt.v_dfree);
                        --page_shortage;