From owner-svn-src-all@freebsd.org Tue Sep 8 04:18:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C16EA00318; Tue, 8 Sep 2015 04:18:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7B2A1096; Tue, 8 Sep 2015 04:18:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t884IvOB063113; Tue, 8 Sep 2015 04:18:57 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t884IvdM063112; Tue, 8 Sep 2015 04:18:57 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201509080418.t884IvdM063112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 8 Sep 2015 04:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287550 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2015 04:18:58 -0000 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