From owner-freebsd-current@freebsd.org Sun Sep 15 01:31:18 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B731D7323 for ; Sun, 15 Sep 2019 01:31:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WBfZ2jwcz3FQm; Sun, 15 Sep 2019 01:31:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id C1F061C925; Sun, 15 Sep 2019 01:31:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Sat, 14 Sep 2019 18:31:16 -0700 (PDT) From: Don Lewis Subject: Re: poudriere, swap full and top says memory is free ? To: John-Mark Gurney cc: Kurt Jaeger , FreeBSD Current In-Reply-To: <20190914182857.GM96402@funkthat.com> Message-ID: References: <20190914173805.GC2863@home.opsec.eu> <20190914182857.GM96402@funkthat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Sep 2019 01:31:18 -0000 On 14 Sep, John-Mark Gurney wrote: > Kurt Jaeger wrote this message on Sat, Sep 14, 2019 at 19:38 +0200: >> - a poudriere build >> - of a list of ports >> - on 12.0-RELEASE-p10 >> - on a 4 core+4 hyperthreads CPU, an Intel(R) Xeon(R) CPU E3-1230 v6 >> @ 3.50GHz >> - with 32 GB RAM >> - zpool with 2x 500 GB SSDs as a mirror >> >> and right now, this can be seen: >> >> last pid: 90922; load averages: 5.02, 5.14, 5.73 up 0+03:53:08 19:31:05 >> 82 processes: 6 running, 76 sleeping >> CPU: 60.6% user, 0.0% nice, 2.1% system, 0.0% interrupt, 37.3% idle >> Mem: 4598M Active, 2854M Inact, 11G Laundry, 6409M Wired, 6375M Free >> ARC: 3850M Total, 1721M MFU, 2090M MRU, 665K Anon, 19M Header, 19M Other >> 3406M Compressed, 3942M Uncompressed, 1.16:1 Ratio >> Swap: 18G Total, 18G Used, 396K Free, 99% Inuse, 68K In >> >> So: Swap is full, approx. 6 GB memory is reported as free. >> >> This is surprising. Can I somehow tune this in any way, so that >> the memory available is used for the build ? Or is the problem somewhere >> else ? > > Are you sure that this hasn't just recently completed a large link of > something like Chromium? There are known to be compiles that can take > many GB's of memory and if they recently exited, there hasn't been time > to swap stuff back in... or is this the steady state over the entire > compile? This is sort of an odd case. I suspect that swap filled and then a process that was using a large amount of memory but no swap exited or was killed. That freed a bunch of memory, but no swap. I'm pretty sure that when a memory page is paged back in from swap, that the copy in swap is retained and not deallocated. Under memory pressure, that allowed the page to be stolen without having to write it back out to swap again, unless it was re-dirtied in the meantime.