From owner-freebsd-current@freebsd.org Sun Aug 20 20:17:56 2017 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 4F056DEAA92 for ; Sun, 20 Aug 2017 20:17:56 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) (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 149407154A; Sun, 20 Aug 2017 20:17:56 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd13.aul.t-online.de (fwd13.aul.t-online.de [172.20.27.62]) by mailout04.t-online.de (Postfix) with SMTP id D2AB941A543C; Sun, 20 Aug 2017 22:08:04 +0200 (CEST) Received: from Stefans-MBP-2.fritz.box (SmG17vZHrh6xr5ZcTTKIr5qyjkMguYTjzk7XtM7IkZ4aM5dB2HNbE33nyV8LWllwg2@[84.154.118.146]) by fwd13.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1djWVt-0knL1M0; Sun, 20 Aug 2017 22:08:01 +0200 Subject: Re: swapfile query To: Greg 'groggy' Lehey , tech-lists Cc: freebsd-current@freebsd.org References: <77fdd002-2873-eb67-c851-0127ae3141b6@zyxst.net> <20170819233919.GD91313@eureka.lemis.com> From: Stefan Esser Message-ID: <5de1cb15-0147-e17b-d5f9-3feca87ec4ff@freebsd.org> Date: Sun, 20 Aug 2017 22:08:00 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170819233919.GD91313@eureka.lemis.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-ID: SmG17vZHrh6xr5ZcTTKIr5qyjkMguYTjzk7XtM7IkZ4aM5dB2HNbE33nyV8LWllwg2 X-TOI-MSGID: 146b1c9b-48fc-4e4f-a079-2a20a70baa6e X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 20 Aug 2017 20:17:56 -0000 Am 20.08.17 um 01:39 schrieb Greg 'groggy' Lehey: >> 3. should total swap be 1x 2x or some other multiple of RAM these days? > > It never needed to be. The only issue is that if you want processor > dumps, you once needed a swap partition (and not a swap file) at least > marginally larger than memory. With compressed dumps, that > requirement is relaxed, but I suspect that a 4 GB partition could be > too small. Well, no, it (2x RAM) used to be needed at a time ... ;-) The VAX supported paging, but did not use a multi-level page table as most CPUs do today. There was a linear list of page addresses per process, and new page allocations could lead to a situation, where there was no free space in this list. This required a kind of garbage collection run, which was implemented by swapping out all processes and starting with a clean state. This required 2 times RAM configured as swap, to prevent a dead-lock (when a new page needed to be allocated to complete the swap-out). This MMU was used in at least all VAX 11-7xx, the µVAX 2 and µVAX 3 and thus in many of the machines used to run BSD back in the 80s ... And thus, swap of at least 2 times RAM used to be not just a best practice, but a strict requirement for stable operation of these machines. Regards, STefan