From owner-freebsd-hackers@freebsd.org Sun Nov 18 01:54:59 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2628211215AA for ; Sun, 18 Nov 2018 01:54:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FC618C2B4; Sun, 18 Nov 2018 01:54:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id OCIUg1o6qP7x2OCIWgs8Zn; Sat, 17 Nov 2018 18:54:55 -0700 X-Authority-Analysis: v=2.3 cv=X9GD11be c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=JHtHm7312UAA:10 a=CjxXgO3LAAAA:8 a=6I5d2MoRAAAA:8 a=YVOhz5M6AAAA:8 a=YxBL1-UpAAAA:8 a=pRaooDUxaH_drk4u2DsA:9 a=Jamy6s-ylp-W1LSt:21 a=A-3pYsgeXlPRBYIO:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=sbbTL3E6IKcx-RquDtO-:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 66B8CA6B; Sat, 17 Nov 2018 17:54:50 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wAI1sn0X049217; Sat, 17 Nov 2018 17:54:49 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wAI1smhg049214; Sat, 17 Nov 2018 17:54:48 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201811180154.wAI1smhg049214@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mark Millard cc: Mark Johnston , Rebecca Cran , Wojciech Puchar , Ian Lepore , freebsd-hackers Hackers Subject: Re: 13-CURRENT: several GB swap being used despite plenty of free RAM In-Reply-To: Message from Mark Millard via freebsd-hackers of "Sat, 17 Nov 2018 16:41:55 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 17 Nov 2018 17:54:48 -0800 X-CMAE-Envelope: MS4wfHl8bG2kLuIQGMshfd/g6QO4wY9xy3JzJaSIyYHgg/WqApQnQQ7WmQnFVRQkcUqvNObfjF6HV0gRWFxRZFwwz0+PBBYYEiFnCk7pnK2D/VIsBZVnj/1L lrd6ckbrarucXblmUrQGs4sVkMtAxCvz1SAHVs0xqe1473esa1AYzgp+yeWzYKBfqpsWt/0OC2VX/PhnzUxuIbiTo/r9Wy1de0SXx67WdEUFOSBc5OxfetJU T8+fAFUPtHnc3Lq981wCVL9xkS1+t5+TymXdB2cdp2i+NmcRwlS8+dywr6cTseBtfcv5UZQ5nZ7dRwyOG+9aGjkYQOP29+zBBlITdhm+gDM= X-Rspamd-Queue-Id: 0FC618C2B4 X-Spamd-Result: default: False [-1.51 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[yahoo.com]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.87)[ipnet: 64.59.128.0/20(-2.38), asn: 6327(-1.90), country: CA(-0.10)]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:54:59 -0000 In message , Mark Millard via f reebsd-hackers writes: > On 2018-Nov-17, at 16:13, Mark Johnston wrote: > > > > On Sat, Nov 17, 2018 at 04:59:48PM -0700, Ian Lepore wrote: > >> On Sat, 2018-11-17 at 22:52 +0100, Wojciech Puchar wrote: > >>> freebsd will not swap with that lots of free ram. > >>> but it's 90GB free NOW, how about before? > >>> > >> > >> Your information is outdated. For at least a couple years now (since > >> approximately the 10.1 - 10.2 timeframe is my vague estimate), freebsd > >> will page out application memory that hasn't been referenced for some > >> time, even when the system has no shortage of free memory at all. > > > > No, FreeBSD will only ever swap when there is a free page shortage. The > > difference is that we now slowly age unreferenced pages into the > > inactive queue, which makes them candidates for pageout and subsequent > > eviction. With pageout_update_period=0, anonymous memory won't get > > paged out unless there's a shortage of inactive pages, or an application > > calls madvise(MADV_DONTNEED) on a range of memory (which moves any > > backing pages to the inactive queue). > > Swapping is built on top of paging as I understand. The system > can page without swapping but can not swap without (effectively) > paging to implement the swapping, if I understand right. If I > understand right, swapped-out means that kernel stacks have > been written out and have to be loaded back in RAM before the > process/threads can even run. (I might not understand.) > > If I've got that right, are there distinctions here for > paging that is not part of swapping vs. actual swapping > (and its use of paging)? Saying that something does not > swap does not necessarily imply that it does not page: > it still could have paging activity that does not include > moving the kernel stacks for the process to backing media? This is generally the old-school definition, IIRC third year comp sci, original BSD definition, which was also the way IBM defined it for MVS. (IBM also virtually swapped out address spaces, not written to DASD, as a means to deny CPU cycles through the scheduler not given the chance to consider the tasks (threads) in the address space). You can disable swapping by setting vm.swap_enabled=0. > > At times I have trouble interpreting when wording goes back > and forth between swapping and paging, both for the intended > meaning and for the technical implications. > > >> The advice I was recently given to revert to the old behavior is: > >> > >> sysctl vm.pageout_update_period=0 > >> > >> I've been using it on a couple systems here for a few days now, and so > >> far results are promising, I am no longer seeing gratuitous swapfile > >> usage on systems that have so much free physical ram that they should > >> never need to page anything out. I haven't yet pushed one of those > >> systems hard enough to check what happens when they do need to start > >> proactively paging out inactive memory due to shortages -- it could be > >> that turning off the new behavior has downsides for some workloads. > > > > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.