From owner-svn-src-user@freebsd.org Fri Jul 29 17:28:15 2016 Return-Path: Delivered-To: svn-src-user@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 A682EBA881A for ; Fri, 29 Jul 2016 17:28:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5F8651FAB; Fri, 29 Jul 2016 17:28:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6THSEDH086727; Fri, 29 Jul 2016 17:28:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6THSEtf086726; Fri, 29 Jul 2016 17:28:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607291728.u6THSEtf086726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 17:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303496 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2016 17:28:15 -0000 Author: markj Date: Fri Jul 29 17:28:14 2016 New Revision: 303496 URL: https://svnweb.freebsd.org/changeset/base/303496 Log: Remove a redundant variable for the target number of laundry cycles. Suggested by: alc Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Jul 29 17:18:47 2016 (r303495) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Jul 29 17:28:14 2016 (r303496) @@ -1090,7 +1090,7 @@ vm_pageout_laundry_worker(void *arg) struct vm_domain *domain; uint64_t ninact, nlaundry; u_int wakeups, gen; - int cycle, tcycle, domidx, launder; + int cycle, domidx, launder; int shortfall, prev_shortfall, target; domidx = (uintptr_t)arg; @@ -1098,7 +1098,7 @@ vm_pageout_laundry_worker(void *arg) KASSERT(domain->vmd_segs != 0, ("domain without segments")); vm_pageout_init_marker(&domain->vmd_laundry_marker, PQ_LAUNDRY); - cycle = tcycle = 0; + cycle = 0; gen = 0; shortfall = prev_shortfall = 0; target = 0; @@ -1122,10 +1122,9 @@ vm_pageout_laundry_worker(void *arg) * If we're still in shortfall despite a previous * laundering run, start a new one. */ - if (prev_shortfall == 0 || cycle == tcycle) { + if (prev_shortfall == 0 || cycle == 0) { target = shortfall; - cycle = 0; - tcycle = VM_LAUNDER_RATE; + cycle = VM_LAUNDER_RATE; } prev_shortfall = shortfall; } @@ -1137,10 +1136,10 @@ vm_pageout_laundry_worker(void *arg) * shortfall, we have no immediate need to launder * pages. Otherwise keep laundering. */ - if (vm_laundry_target() <= 0 || cycle == tcycle) { + if (vm_laundry_target() <= 0 || cycle == 0) { shortfall = prev_shortfall = target = 0; } else { - launder = target / (tcycle - cycle); + launder = target / cycle; goto dolaundry; } } @@ -1168,8 +1167,7 @@ vm_pageout_laundry_worker(void *arg) * the inactive and laundry queues. We attempt to * finish within one second. */ - cycle = 0; - tcycle = VM_LAUNDER_INTERVAL; + cycle = VM_LAUNDER_INTERVAL; /* * Set our target to that of the pagedaemon, scaled by @@ -1190,8 +1188,8 @@ vm_pageout_laundry_worker(void *arg) */ target = min(target, bkgrd_launder_max); } - if (target > 0 && cycle != tcycle) - launder = target / (tcycle - cycle); + if (target > 0 && cycle != 0) + launder = target / cycle; dolaundry: if (launder > 0) @@ -1200,7 +1198,7 @@ dolaundry: tsleep(&vm_cnt.v_laundry_count, PVM, "laundr", hz / VM_LAUNDER_INTERVAL); - cycle++; + cycle--; } }