From owner-freebsd-stable@freebsd.org Tue Jun 19 07:06:56 2018 Return-Path: Delivered-To: freebsd-stable@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 6EE4F100144C; Tue, 19 Jun 2018 07:06:56 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout05.t-online.de (mailout05.t-online.de [194.25.134.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95EDB6F3A5; Tue, 19 Jun 2018 07:06:55 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd30.aul.t-online.de (fwd30.aul.t-online.de [172.20.26.135]) by mailout05.t-online.de (Postfix) with SMTP id 5DAB44256FCE; Tue, 19 Jun 2018 09:06:46 +0200 (CEST) Received: from Stefans-MBP-204.fritz.box (SgFFUiZSoh9b2PMResQ++ZEnoJEgc3zwxFYShBgE4hc3DftoLsm3fveh5t-MzR1ZB1@[84.154.98.138]) by fwd30.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1fVAix-1m0w9A0; Tue, 19 Jun 2018 09:06:43 +0200 Subject: Re: lightly loaded system eats swap space To: Erich Dollansky , tech-lists Cc: freebsd-stable@freebsd.org, freebsd-questions@freebsd.org References: <20180618160855.44d9a0c2.freebsd.ed.lists@sumeritec.com> <20180619094826.75c0c735.freebsd.ed.lists@sumeritec.com> From: Stefan Esser Openpgp: preference=signencrypt Autocrypt: addr=se@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpE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ABEBAAHCwHwEGAEKACYCGwwWIQSjceplnAvsyCtxUxNH67XvWv31RAUCWvLv qwUJCyUBGQAKCRBH67XvWv31RLnrB/9gzcRlpx71sDMosoZULWn7wysBJ/8AIEfIByRaHQe3 pn/KwE57pB+zFbbQqB7YzeZb7/UUgR4zU2ZbOcEfwDZcHUbj0B3fGRsS3t0uiLlAd8w0sBZb SxrqzjdpDjIbOZkxssqUmvrsN67UG1AFWH9aD24keBS7YjPBS8hLxPeYV+Xz6vUL8fRZje/Z JgiBMIwyj6g2lH/zkdnxBdC0iG1xxJOLTaghMMeQyCdH6ef8+VMyAlAJsMckbOTvx63tY8z7 DFcrnTJfbe1EziRilVsEaK8tTzJzhcTfos+f3eBYWEilxe5HzIhYKJeC7lmsSUcGwa6+9VRg a0ctmi9Z8OgX Message-ID: <7fdc922c-ba19-c822-6f6e-d768533a2876@freebsd.org> Date: Tue, 19 Jun 2018 09:06:42 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180619094826.75c0c735.freebsd.ed.lists@sumeritec.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ID: SgFFUiZSoh9b2PMResQ++ZEnoJEgc3zwxFYShBgE4hc3DftoLsm3fveh5t-MzR1ZB1 X-TOI-MSGID: 08e39055-2f77-4810-a074-8ce5ef090910 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 07:06:56 -0000 Am 19.06.18 um 03:48 schrieb Erich Dollansky: > A very long time ago - and not on FreeBSD but maybe on a real BSD - I > worked with a system that swapped pages out just to bring it back as > one contiguous block. This made a difference those days. I do not know > if the code made it out of the university I was working at. I just > imagine now that the code made it out and is still in use with the > opposite effect. If this was on a VAX, then it was due to a short-coming of the MMU of the VAX, which used one linear array (in system virtual memory) to hold physical addresses of user pages of all programs. Each user program had 2 slices in this array (1 growing up, 1 growing down for the stack) and whenever a program allocated a new page, this slice needed to grow. That leads to fragmentation (same a problem as with realloc() for an ever growing array), and when there was no contiguous free space in the array for a grown slice, then all process where swapped out (resulting in this whole page table array being cleared and thus without fragmentation, since swapped-out processes needed no space in this array). This was a solution that worked without the table walk used in todays VM systems. System pages were mapped by a linear page table in physical memory, while user programs used the above described linear page table in system virtual memory. Nothing of the above applies to any other architecture than the VAX and thus the swap-out of all user processes serves no purpose on any other system. It was an implementation detail of the VAX VM code, not a BSD Unix feature. Regards, STefan