From owner-svn-src-all@freebsd.org Thu Aug 27 20:38:46 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 3C19C9C3C28; Thu, 27 Aug 2015 20:38:46 +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 1398F1A82; Thu, 27 Aug 2015 20:38:46 +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 t7RKcjdQ035619; Thu, 27 Aug 2015 20:38:45 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RKcjmS035618; Thu, 27 Aug 2015 20:38:45 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508272038.t7RKcjmS035618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 27 Aug 2015 20:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287219 - 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: Thu, 27 Aug 2015 20:38:46 -0000 Author: alc Date: Thu Aug 27 20:38:45 2015 New Revision: 287219 URL: https://svnweb.freebsd.org/changeset/base/287219 Log: In vm_pageout_scan(), simplify the logic for determining if a page can be paged out and apply some nearby style fixes. In collaboration with: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation, EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Aug 27 19:12:42 2015 (r287218) +++ head/sys/vm/vm_pageout.c Thu Aug 27 20:38:45 2015 (r287219) @@ -1029,10 +1029,9 @@ vm_pageout_scan(struct vm_domain *vmd, i struct vm_pagequeue *pq; vm_object_t object; long min_scan; - int act_delta, addl_page_shortage, deficit, maxscan, page_shortage; - int vnodes_skipped = 0; - int maxlaunder, scan_tick, scanned; - boolean_t queues_locked; + int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan; + int page_shortage, scan_tick, scanned, vnodes_skipped; + boolean_t pageout_ok, queues_locked; /* * If we need to reclaim memory ask kernel caches to return @@ -1086,6 +1085,8 @@ vm_pageout_scan(struct vm_domain *vmd, i if (pass > 1) maxlaunder = 10000; + vnodes_skipped = 0; + /* * Start scanning the inactive queue for pages we can move to the * cache or free. The scan will stop when the target is reached or @@ -1265,23 +1266,22 @@ vm_pageout_scan(struct vm_domain *vmd, i * pressure where there are insufficient clean pages * on the inactive queue, we may have to go all out. */ - int swap_pageouts_ok; - int error; - if ((object->type != OBJT_SWAP) && (object->type != OBJT_DEFAULT)) { - swap_pageouts_ok = 1; - } else { - swap_pageouts_ok = !(defer_swap_pageouts || disable_swap_pageouts); - swap_pageouts_ok |= (!disable_swap_pageouts && defer_swap_pageouts && - vm_page_count_min()); - - } + if (object->type != OBJT_SWAP && + object->type != OBJT_DEFAULT) + pageout_ok = TRUE; + else if (disable_swap_pageouts) + pageout_ok = FALSE; + else if (defer_swap_pageouts) + pageout_ok = vm_page_count_min(); + else + pageout_ok = TRUE; /* * We don't bother paging objects that are "dead". * Those objects are in a "rundown" state. */ - if (!swap_pageouts_ok || (object->flags & OBJ_DEAD)) { + if (!pageout_ok || (object->flags & OBJ_DEAD) != 0) { vm_pagequeue_lock(pq); vm_page_unlock(m); VM_OBJECT_WUNLOCK(object);