From owner-freebsd-current@freebsd.org Sun Mar 13 16:56:40 2016 Return-Path: Delivered-To: freebsd-current@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 D73F2ACD76E for ; Sun, 13 Mar 2016 16:56:40 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C545B65E for ; Sun, 13 Mar 2016 16:56:40 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: by mailman.ysv.freebsd.org (Postfix) id C0927ACD76D; Sun, 13 Mar 2016 16:56:40 +0000 (UTC) Delivered-To: current@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 C02CBACD76C for ; Sun, 13 Mar 2016 16:56:40 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.18.14]) (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 8764665D for ; Sun, 13 Mar 2016 16:56:40 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [78.35.186.173] (helo=fabiankeil.de) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1af89r-0008TS-CH; Sun, 13 Mar 2016 16:42:19 +0100 Date: Sun, 13 Mar 2016 16:41:17 +0100 From: Fabian Keil To: Gary Jennejohn Cc: current@freebsd.org Subject: Re: how to recycle Inact memory more aggressively? Message-ID: <20160313164117.0301b79e@fabiankeil.de> In-Reply-To: <20160312093835.727d7197@ernst.home> References: <20160312093835.727d7197@ernst.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/ZBTGujQiGZtmMnKpjqI.G2Z"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 16:56:40 -0000 --Sig_/ZBTGujQiGZtmMnKpjqI.G2Z Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Gary Jennejohn wrote: > In the course of the last year or so the behavior of the vm system > has changed in regard to how aggressively Inact memory is recycled. >=20 > My box has 8GB of memory. At the moment I'm copying 100s of gigabytes > from one file system to another one. >=20 > Looking at top I observe that there are about 6GB of Inact memory. > This value hardly changes. Instead of aggressively recycling the > Inact memory the vm now seems to prefer to swap. Are you using ZFS? > Last year, can't rmember excatly when, the behavior was totally > different. The vm very aggessively recycled Inact memory and, > even when copying 100s of GB of files, the system hardly swapped. >=20 > It seems rather strange to me that the vm happily allows gigbytes > of Inact memory to be present and prefers swapping to recyclincg. > > Are there any sysctl's I can set to get the old behavior back? I don't think so. I'm currently using this patch set to work around the issue: https://www.fabiankeil.de/sourcecode/electrobsd/vm-limit-inactive-memory-mo= re-aggressively.diff Patch 4 adds a couple of sysctls that can be used to let the ZFS ARC indirectly put pressure on the inactive memory until a given target is reached. Fabian --Sig_/ZBTGujQiGZtmMnKpjqI.G2Z Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlblih0ACgkQBYqIVf93VJ2o/ACfX6vJ20dT/Je5Fr7DNmm6VAYU ZewAoIpW9cgiZxa5SG4cCgUrvw5tiXlc =ejF6 -----END PGP SIGNATURE----- --Sig_/ZBTGujQiGZtmMnKpjqI.G2Z--