From owner-svn-src-all@FreeBSD.ORG Wed May 7 13:05:22 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D336F398; Wed, 7 May 2014 13:05:22 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6B7B692; Wed, 7 May 2014 13:05:21 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wi1XE-000CkB-DJ; Wed, 07 May 2014 13:05:20 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s47D5GfW027506; Wed, 7 May 2014 07:05:16 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+2HtPrEMBq5HgE1n70yw6F Subject: Re: svn commit: r265418 - head/sys/vm From: Ian Lepore To: Alan Cox In-Reply-To: <5369777F.6010203@rice.edu> References: <201405060342.s463g5Fx047447@svn.freebsd.org> <1399379941.22079.263.camel@revolution.hippie.lan> <5369777F.6010203@rice.edu> Content-Type: text/plain; charset="us-ascii" Date: Wed, 07 May 2014 07:05:16 -0600 Message-ID: <1399467916.22079.289.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Wed, 07 May 2014 13:05:23 -0000 On Tue, 2014-05-06 at 18:59 -0500, Alan Cox wrote: > On 05/06/2014 07:39, Ian Lepore wrote: > > On Tue, 2014-05-06 at 03:42 +0000, Alan Cox wrote: > >> Author: alc > >> Date: Tue May 6 03:42:04 2014 > >> New Revision: 265418 > >> URL: http://svnweb.freebsd.org/changeset/base/265418 > >> > >> Log: > >> Prior to r254304, a separate function, vm_pageout_page_stats(), was used to > >> periodically update the reference status of the active pages. This function > >> was called, instead of vm_pageout_scan(), when memory was not scarce. The > >> objective was to provide up to date reference status for active pages in > >> case memory did become scarce and active pages needed to be deactivated. > >> > >> The active page queue scan performed by vm_pageout_page_stats() was > >> virtually identical to that performed by vm_pageout_scan(), and so r254304 > >> eliminated vm_pageout_page_stats(). Instead, vm_pageout_scan() is > >> called with the parameter "pass" set to zero. The intention was that when > >> pass is zero, vm_pageout_scan() would only scan the active queue. However, > >> the variable page_shortage can still be greater than zero when memory is not > >> scarce and vm_pageout_scan() is called with pass equal to zero. > >> Consequently, the inactive queue may be scanned and dirty pages laundered > >> even though that was not intended by r254304. This revision fixes that. > >> > >> Reported by: avg > >> MFC after: 1 week > >> 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 May 6 03:38:04 2014 (r265417) > >> +++ head/sys/vm/vm_pageout.c Tue May 6 03:42:04 2014 (r265418) > >> @@ -942,13 +942,15 @@ vm_pageout_scan(struct vm_domain *vmd, i > >> */ > >> addl_page_shortage = 0; > >> > >> - deficit = atomic_readandclear_int(&vm_pageout_deficit); > >> - > >> /* > >> * Calculate the number of pages we want to either free or move > >> * to the cache. > >> */ > >> - page_shortage = vm_paging_target() + deficit; > >> + if (pass > 0) { > >> + deficit = atomic_readandclear_int(&vm_pageout_deficit); > >> + page_shortage = vm_paging_target() + deficit; > >> + } else > >> + page_shortage = deficit = 0; > >> > >> /* > >> * maxlaunder limits the number of dirty pages we flush per scan. > >> > > Does this address the observation that several folks have made on > > current@ that pages are being pushed to swap much more agressively than > > in the past, even when the system doesn't seem short of memory? > > > > I hope so. Please let me know if you see any difference. > > I also suspect that another side-effect of r254304 is that we are > swapping out idle processes sooner, before memory has become scarce. > Has anyone observed this behavior? > > Alan > I haven't seen the problem myself (I generally use option NO_SWAPPING on my ARM stuff), but there was some mailing-list talk about it. This is the main thread I was thinking of: http://lists.freebsd.org/pipermail/freebsd-stable/2014-April/078361.html I wonder if this one could be related too? http://lists.freebsd.org/pipermail/freebsd-stable/2014-January/077044.html -- Ian