From owner-freebsd-hackers@freebsd.org Mon Feb 6 12:19:09 2017 Return-Path: Delivered-To: freebsd-hackers@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 C7E03CD2C82 for ; Mon, 6 Feb 2017 12:19:09 +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 90365F44 for ; Mon, 6 Feb 2017 12:19:09 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [78.35.162.27] (helo=fabiankeil.de) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from ) id 1caiG8-0005U9-CO for freebsd-hackers@freebsd.org; Mon, 06 Feb 2017 13:19:04 +0100 Date: Mon, 6 Feb 2017 13:17:11 +0100 From: Fabian Keil To: freebsd-hackers@freebsd.org Subject: Re: Inactive memory Message-ID: <20170206131711.76fe19ed@fabiankeil.de> In-Reply-To: <20170206102159.GD5366@zxy.spb.ru> References: <20170206102159.GD5366@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/S/KiEkDC3mB4xT5c9GJfKTx"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2017 12:19:09 -0000 --Sig_/S/KiEkDC3mB4xT5c9GJfKTx Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Slawa Olhovchenkov wrote: > What is 'Inactive' memory? =46rom sys/vm/vm_page.h: /* * Each pageable resident page falls into one of four lists: * * free * Available for allocation now. * * cache * Almost available for allocation. Still associated with * an object, but clean and immediately freeable. * * The following lists are LRU sorted: * * inactive * Low activity, candidates for reclamation. * This is the list of pages that should be * paged out next. * * active * Pages that are "active" i.e. they have been * recently referenced. * */ A case-insensitive grep for "inactive" in the directory will result in a couple of additional relevant comments and implementation details. > Can I let is definitly availably for allocation (after some time)? > Under some load I am got about 30GB of Inactive memory and I am > prefer migrate this memory to ARC cache. >=20 > Can I have assurance about freeing this memory under pressure? While inactive memory is supposed to be freed under memory pressure, in vanilla FreeBSD the ARC may shrink to relieve memory pressure first. In extreme case the ARC may shrink to its limit while the inactive memory continues to grow. In ElectroBSD, this patch is supposed to address this: https://www.fabiankeil.de/sourcecode/electrobsd/ElectroBSD-r312620-6cfa243f= 1516/0239-sys-vm-Limit-the-inactive-pages-more-aggressively.diff You could give it a try to see if it helps for your workload. If you haven't already, you also may want to look at: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D187594 Among other things, it contains a bunch of (conflicting) theories about how the system behaves under memory pressure. Fabian --Sig_/S/KiEkDC3mB4xT5c9GJfKTx Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTKUNd6H/m3+ByGULIFiohV/3dUnQUCWJhpRwAKCRAFiohV/3dU nf4cAJ4/eaiIiQqTvAAFTswZtzNPfo8IiQCgitYZJOCF5SUa+nzRpu3/LMoRgZ8= =fyaM -----END PGP SIGNATURE----- --Sig_/S/KiEkDC3mB4xT5c9GJfKTx--