Date: Tue, 8 Sep 2015 04:18:57 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287550 - head/sys/vm Message-ID: <201509080418.t884IvdM063112@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Tue Sep 8 04:18:57 2015 New Revision: 287550 URL: https://svnweb.freebsd.org/changeset/base/287550 Log: To simplify upcoming changes to the inactive queue scan, change the code so that there is only one place where pages are freed and only one place where pages are moved to the tail of the queue. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Sep 8 02:02:08 2015 (r287549) +++ head/sys/vm/vm_pageout.c Tue Sep 8 04:18:57 2015 (r287550) @@ -1178,12 +1178,8 @@ unlock_page: * Invalid pages can be easily freed. They cannot be * mapped, vm_page_free() asserts this. */ - if (m->valid == 0) { - vm_page_free(m); - PCPU_INC(cnt.v_dfree); - --page_shortage; - goto drop_page; - } + if (m->valid == 0) + goto free_page; /* * If the page has been referenced and the object is not dead, @@ -1214,12 +1210,8 @@ unlock_page: */ m->act_count += act_delta + ACT_ADVANCE; goto drop_page; - } else if ((object->flags & OBJ_DEAD) == 0) { - vm_pagequeue_lock(pq); - queues_locked = TRUE; - vm_page_requeue_locked(m); - goto drop_page; - } + } else if ((object->flags & OBJ_DEAD) == 0) + goto requeue_page; } /* @@ -1240,6 +1232,7 @@ unlock_page: /* * Clean pages can be freed. */ +free_page: vm_page_free(m); PCPU_INC(cnt.v_dfree); --page_shortage; @@ -1266,6 +1259,7 @@ unlock_page: * the thrash point for a heavily loaded machine. */ m->flags |= PG_WINATCFLS; +requeue_page: vm_pagequeue_lock(pq); queues_locked = TRUE; vm_page_requeue_locked(m); @@ -1287,12 +1281,8 @@ unlock_page: pageout_ok = vm_page_count_min(); else pageout_ok = TRUE; - if (!pageout_ok) { - vm_pagequeue_lock(pq); - queues_locked = TRUE; - vm_page_requeue_locked(m); - goto drop_page; - } + if (!pageout_ok) + goto requeue_page; error = vm_pageout_clean(m); /* * Decrement page_shortage on success to account for
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509080418.t884IvdM063112>