From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 02:38:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 02:38:31 -0400 Received: from snark.tuxedo.org ([207.106.50.26]:60422 "EHLO snark.thyrsus.com") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 02:38:16 -0400 Date: Sun, 19 Aug 2001 02:42:33 -0400 From: "Eric S. Raymond" To: Linux Kernel List Cc: gars@lanm-pc.com Subject: Swap size for a machine with 2GB of memory Message-ID: <20010819024233.A26916@thyrsus.com> Reply-To: esr@thyrsus.com Mail-Followup-To: "Eric S. Raymond" , Linux Kernel List , gars@lanm-pc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: Eric Conspiracy Secret Labs X-Eric-Conspiracy: There is no conspiracy Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org The Red Hat installation manual claims that the size of the swap partition should be twice the size of physical memory, but no more than 128MB. The screaming hotrod machine Gary Sandine and I built around the Tyan S2464 has 2GB of physical memory. Should I believe the above formula? If not, is there a more correct one for calculating needed swap on machines with very large memory? (No further hangs, BTW.) -- Eric S. Raymond .. a government and its agents are under no general duty to provide public services, such as police protection, to any particular individual citizen... -- Warren v. District of Columbia, 444 A.2d 1 (D.C. App.181) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 05:46:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 05:46:49 -0400 Received: from [209.202.108.240] ([209.202.108.240]:16904 "EHLO terbidium.openservices.net") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 05:46:36 -0400 Date: Sun, 19 Aug 2001 05:46:32 -0400 (EDT) From: Ignacio Vazquez-Abrams To: "Eric S. Raymond" cc: Linux Kernel List , Subject: Re: Swap size for a machine with 2GB of memory In-Reply-To: <20010819024233.A26916@thyrsus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-scanner: scanned by Inflex 1.0.7 - (http://pldaniels.com/inflex/) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 19 Aug 2001, Eric S. Raymond wrote: > The Red Hat installation manual claims that the size of the swap partition > should be twice the size of physical memory, but no more than 128MB. > > The screaming hotrod machine Gary Sandine and I built around the Tyan S2464 > has 2GB of physical memory. Should I believe the above formula? If not, > is there a more correct one for calculating needed swap on machines with > very large memory? > > (No further hangs, BTW.) I'm not an authority on swap under Linux, but I can tell you about my personal experiences, and I hope it helps you. In reality, machines with as little as 192 MB of RAM don't necessarily need swap space. Of course, it depends on what you're doing with it. A machine like that would be used solely as a high-powered office machine or a low-grade workstation. At the other extreme, I've heard of machines that are running heavy scientific applications. They have 4 GB of RAM and run with 10+ GB of swap. A machine with 2 GB of RAM can easily live with no swap, unless you want to run web, proxy, or database servers in very large configurations, or if you compile software several times the size of XFree86 with any regularity. By "very large configurations" I mean something you would have to deliberately set, probably requiring a change to defined constants in the software. -- Ignacio Vazquez-Abrams From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 10:05:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 10:05:40 -0400 Received: from lightning.swansea.linux.org.uk ([194.168.151.1]:16398 "EHLO the-village.bc.nu") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 10:05:33 -0400 Subject: Re: Swap size for a machine with 2GB of memory To: esr@thyrsus.com Date: Sun, 19 Aug 2001 15:08:28 +0100 (BST) Cc: linux-kernel@vger.kernel.org (Linux Kernel List), gars@lanm-pc.com In-Reply-To: <20010819024233.A26916@thyrsus.com> from "Eric S. Raymond" at Aug 19, 2001 02:42:33 AM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: From: Alan Cox Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > The screaming hotrod machine Gary Sandine and I built around the Tyan S2464 > has 2GB of physical memory. Should I believe the above formula? If not, The formula is sort of true for 2.4 due to VM issues, its no longer true for 2.4-ac because Rik fixed the weakness in question, and it wont matter if you are not running >2Gb of toys anyway Good that its no longer hung again - this is with noapic now ? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 12:15:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 12:15:32 -0400 Received: from asterix.hrz.tu-chemnitz.de ([134.109.132.84]:29864 "EHLO asterix.hrz.tu-chemnitz.de") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 12:15:29 -0400 Date: Sun, 19 Aug 2001 18:15:41 +0200 From: Ingo Oeser To: Ignacio Vazquez-Abrams Cc: "Eric S. Raymond" , Linux Kernel List , gars@lanm-pc.com Subject: Re: Swap size for a machine with 2GB of memory Message-ID: <20010819181541.L9870@nightmaster.csn.tu-chemnitz.de> In-Reply-To: <20010819024233.A26916@thyrsus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from ignacio@openservices.net on Sun, Aug 19, 2001 at 05:46:32AM -0400 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 19, 2001 at 05:46:32AM -0400, Ignacio Vazquez-Abrams wrote: > At the other extreme, I've heard of machines that are running heavy scientific > applications. They have 4 GB of RAM and run with 10+ GB of swap. > > A machine with 2 GB of RAM can easily live with no swap, unless you want to > run web, proxy, or database servers in very large configurations, or if you > compile software several times the size of XFree86 with any regularity. By > "very large configurations" I mean something you would have to deliberately > set, probably requiring a change to defined constants in the software. One word here: tmpfs. I use several amounts of RAM as tmpfs. And with that you can certainly reach the point of swapping sth. out. But my machine has only 1GB of RAM and I set up only 2GB of swap. I compile and test many things there directly from the CVS, run things like the fcgp to produce nearly a GB of PostScript files and many more fun things. So if you plan to use tmpfs, better have enough swap available. Files in tmpfs can also not be removed by the OOM killer. So you should define your tmpfs limits properly. Regards Ingo Oeser -- Isn't vi that text editor with two modes... one that beeps and one that corrupts your file? --- Dan Jacobson in comp.os.linux.advocacy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 12:40:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 12:40:11 -0400 Received: from mail.mesatop.com ([208.164.122.9]:3597 "EHLO thor.mesatop.com") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 12:39:54 -0400 Message-Id: <200108191640.f7JGe6e26578@thor.mesatop.com> Content-Type: text/plain; charset=US-ASCII From: Steven Cole Reply-To: elenstev@mesatop.com To: "Eric S. Raymond" , Linux Kernel List Subject: Re: Swap size for a machine with 2GB of memory Date: Sun, 19 Aug 2001 10:39:48 -0400 X-Mailer: KMail [version 1.2.3] Cc: gars@lanm-pc.com In-Reply-To: <20010819024233.A26916@thyrsus.com> In-Reply-To: <20010819024233.A26916@thyrsus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 19 August 2001 02:42 am, Eric S. Raymond wrote: > The Red Hat installation manual claims that the size of the swap partition > should be twice the size of physical memory, but no more than 128MB. ----------------------------------------------------------------^^^^^ For the benefit of anyone finding this in the kernel archives and any future Linux technical historians, this 128MB swap partition limit was fixed by a patch submitted by Stephen C. Tweedie on 9 Jul 1998, and which appeared in 2.1.109 on 20 Jul 1998. Steven From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 12:44:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 12:44:31 -0400 Received: from snark.tuxedo.org ([207.106.50.26]:52231 "EHLO snark.thyrsus.com") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 12:44:23 -0400 Date: Sun, 19 Aug 2001 12:48:31 -0400 From: "Eric S. Raymond" To: Alan Cox Cc: Linux Kernel List , gars@lanm-pc.com Subject: Re: Swap size for a machine with 2GB of memory Message-ID: <20010819124831.A6914@thyrsus.com> Reply-To: esr@thyrsus.com Mail-Followup-To: "Eric S. Raymond" , Alan Cox , Linux Kernel List , gars@lanm-pc.com In-Reply-To: <20010819024233.A26916@thyrsus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from alan@lxorguk.ukuu.org.uk on Sun, Aug 19, 2001 at 03:08:28PM +0100 Organization: Eric Conspiracy Secret Labs X-Eric-Conspiracy: There is no conspiracy Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Alan Cox : > Good that its no longer hung again - this is with noapic now ? APIC is on. -- Eric S. Raymond When only cops have guns, it's called a "police state". -- Claire Wolfe, "101 Things To Do Until The Revolution" From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 13:29:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 13:29:07 -0400 Received: from Expansa.sns.it ([192.167.206.189]:57354 "EHLO Expansa.sns.it") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 13:28:59 -0400 Date: Sun, 19 Aug 2001 19:29:14 +0200 (CEST) From: Luigi Genoni To: "Eric S. Raymond" cc: Linux Kernel List , Subject: Re: Swap size for a machine with 2GB of memory In-Reply-To: <20010819024233.A26916@thyrsus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 19 Aug 2001, Eric S. Raymond wrote: > The Red Hat installation manual claims that the size of the swap partition > should be twice the size of physical memory, but no more than 128MB. ??? with old 2.0 kernels there was a limit to swap partition of 128MB each one, and then you could use a lot of them if you have need of a lot of swap. > > The screaming hotrod machine Gary Sandine and I built around the Tyan S2464 > has 2GB of physical memory. Should I believe the above formula? If not, > is there a more correct one for calculating needed swap on machines with > very large memory? Depends of what is your need. in general kernel 2.4 needs of more swap space in front of 2.2. To explain why whould be long, it's due to VM change and a different page aging. You can check in a kml archive to find an explanetion in a better english than mine. with early 2.4 kernel Linus suggested to have a swap area double in front of the physical ram. That was expecially true for pc having big amount of ram that are going to have long uptimes. On my ultrasparc linux with 4 GByte of RAM running 2.4.X kernels, I needed to add a 8 GB disk just for swap (16 partitions of 512 MB each one). But that is because i needed all that swap for what my users where running on this server at the times. (now this sun 3500 has been sended to other use, SOB!) On the other side, if you are going to run some applications that do not require a lot of memory, it could happen that you will never touch the swap for more that some Mbyte. In generel it is a good thing to have an amount of swap bigger than your physical ram, but not too mutch. if you need a swap 4 times bigger than your physical ram that means you should buy more ram. bests Luigi > > (No further hangs, BTW.) > -- > Eric S. Raymond > > .. a government and its agents are under no general duty to > provide public services, such as police protection, to any > particular individual citizen... > -- Warren v. District of Columbia, 444 A.2d 1 (D.C. App.181) > - From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 13:53:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 13:53:12 -0400 Received: from mail.mesatop.com ([208.164.122.9]:26125 "EHLO thor.mesatop.com") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 13:52:59 -0400 Message-Id: <200108191753.f7JHr8e27206@thor.mesatop.com> Content-Type: text/plain; charset=US-ASCII From: Steven Cole Reply-To: elenstev@mesatop.com To: Luigi Genoni , "Eric S. Raymond" Subject: Re: Swap size for a machine with 2GB of memory Date: Sun, 19 Aug 2001 11:52:50 -0400 X-Mailer: KMail [version 1.2.3] Cc: Linux Kernel List , In-Reply-To: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 19 August 2001 01:29 pm, Luigi Genoni wrote: [snipped] > On my ultrasparc linux with 4 GByte of RAM running 2.4.X kernels, > I needed to add a 8 GB disk just for > swap (16 partitions of 512 MB each one). --------^^ Just curious, in linux-2.4.9/include/linux/swap.h line 11, we have: #define MAX_SWAPFILES 8 Did you change this to 16, or does this not matter anymore? This value is the same in 2.4.8-ac7. Steven From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 15:10:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 15:10:22 -0400 Received: from green.mif.pg.gda.pl ([153.19.42.8]:10245 "EHLO green.mif.pg.gda.pl") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 15:10:13 -0400 From: Andrzej Krzysztofowicz Message-Id: <200108190825.KAA00983@kufel.dom> Subject: Re: Swap size for a machine with 2GB of memory To: kufel!thyrsus.com!esr@green.mif.pg.gda.pl Date: Sun, 19 Aug 2001 10:25:36 +0200 (CEST) Cc: kufel!vger.kernel.org!linux-kernel@green.mif.pg.gda.pl (Linux Kernel List), kufel!lanm-pc.com!gars@green.mif.pg.gda.pl In-Reply-To: <20010819024233.A26916@thyrsus.com> from "Eric S. Raymond" at sie 19, 2001 02:42:33 X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > The Red Hat installation manual claims that the size of the swap partition > should be twice the size of physical memory, but no more than 128MB. This manual is outdated. 1. You hahe 2GB limit for a single swap file/partition now. And you can use many of them. 2. it sjould be <= 2* RAM, i.e. 0 <= SWAP <= 2*RAM. More is inefficient. 3. except kernels 2.4.x, where x <= 7-ac8, where you should have SWAP=0 or SWAP > RAM. 2.4.7-ac9 & 2.4.8 have already this problem fixed. > The screaming hotrod machine Gary Sandine and I built around the Tyan S2464 > has 2GB of physical memory. Should I believe the above formula? If not, > is there a more correct one for calculating needed swap on machines with > very large memory? Correct and universal formula for swap size is as always: SWAP = MAX_RAM_you_ever_need - physical_RAM_you_have However in 2.4 more eficient (and in 2.40-7 obligatory) is: SWAP = MAX_RAM_you_ever_need > physical_RAM_you_have ? MAX_RAM_you_ever_need ;) Andrzej From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 16:56:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 16:56:32 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:54825 "EHLO flinx.biederman.org") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 16:56:25 -0400 To: esr@thyrsus.com Cc: Linux Kernel List , gars@lanm-pc.com Subject: Re: Swap size for a machine with 2GB of memory In-Reply-To: <20010819024233.A26916@thyrsus.com> From: ebiederm@xmission.com (Eric W. Biederman) Date: 19 Aug 2001 14:49:23 -0600 In-Reply-To: <20010819024233.A26916@thyrsus.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org "Eric S. Raymond" writes: > The Red Hat installation manual claims that the size of the swap partition > should be twice the size of physical memory, but no more than 128MB. > > The screaming hotrod machine Gary Sandine and I built around the Tyan S2464 > has 2GB of physical memory. Should I believe the above formula? If not, > is there a more correct one for calculating needed swap on machines with > very large memory? There is no magic formula for calculating the amount of swap space needed. It really needs to be sized to the expected load on your box plus some. If you seriously expect to be using swap, have swapsize > memsize and figure the amount of virtual memory you have is swapsize. With respect to swap partitions the current limit is about 64Gig. You can actually make a larger swap partition but the kernel on x86 only uses 24 offset bits into that partition. The 128MB partition existed but was removed long ago. Eric From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 17:12:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 17:11:54 -0400 Received: from snark.tuxedo.org ([207.106.50.26]:20232 "EHLO snark.thyrsus.com") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 17:11:49 -0400 Date: Sun, 19 Aug 2001 17:15:58 -0400 From: "Eric S. Raymond" To: "Eric W. Biederman" Cc: Linux Kernel List , gars@lanm-pc.com Subject: Re: Swap size for a machine with 2GB of memory Message-ID: <20010819171558.A9057@thyrsus.com> Reply-To: esr@thyrsus.com Mail-Followup-To: "Eric S. Raymond" , "Eric W. Biederman" , Linux Kernel List , gars@lanm-pc.com In-Reply-To: <20010819024233.A26916@thyrsus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from ebiederm@xmission.com on Sun, Aug 19, 2001 at 02:49:23PM -0600 Organization: Eric Conspiracy Secret Labs X-Eric-Conspiracy: There is no conspiracy Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Eric W. Biederman : > There is no magic formula for calculating the amount of swap space > needed. It really needs to be sized to the expected load on your box > plus some. If you seriously expect to be using swap, have swapsize > > memsize and figure the amount of virtual memory you have is swapsize. > > With respect to swap partitions the current limit is about 64Gig. > You can actually make a larger swap partition but the kernel on x86 > only uses 24 offset bits into that partition. The 128MB partition > existed but was removed long ago. That's helpful, thanks. -- Eric S. Raymond Never trust a man who praises compassion while pointing a gun at you. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 18:17:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 18:16:50 -0400 Received: from Expansa.sns.it ([192.167.206.189]:38156 "EHLO Expansa.sns.it") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 18:16:37 -0400 Date: Mon, 20 Aug 2001 00:16:46 +0200 (CEST) From: Luigi Genoni To: Steven Cole cc: "Eric S. Raymond" , Linux Kernel List , Subject: Re: Swap size for a machine with 2GB of memory In-Reply-To: <200108191753.f7JHr8e27206@thor.mesatop.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Yes, i changed this value. But i also changed a lot of other #define with bigger values, because of the eavy use of all HW resources my users were needing. (maximum number of processes and so on...) It has been funny. First i installed via NFS the slackware-current for sparc (now obsoleted, and developed at sourceforge as splackware), then i upgraded the kernel, then i installed a new disk to make the swap and so on... The latest kernel i used before the 3500 was sended to other uses was 2.4.7. The worser kernel on that server was 2.4.5, absolutelly it had the worst VM i ever saw on ultrasparc. Luigi On Sun, 19 Aug 2001, Steven Cole wrote: > On Sunday 19 August 2001 01:29 pm, Luigi Genoni wrote: > [snipped] > > On my ultrasparc linux with 4 GByte of RAM running 2.4.X kernels, > > I needed to add a 8 GB disk just for > > swap (16 partitions of 512 MB each one). > --------^^ > Just curious, in linux-2.4.9/include/linux/swap.h line 11, we have: > > #define MAX_SWAPFILES 8 > > Did you change this to 16, or does this not matter anymore? > This value is the same in 2.4.8-ac7. > > Steven > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 20:05:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 20:05:09 -0400 Received: from ch-12-44-139-249.lcisp.com ([12.44.139.249]:27008 "HELO dual.lcisp.com") by vger.kernel.org with SMTP id ; Sun, 19 Aug 2001 20:04:59 -0400 From: "Kevin Krieser" To: "Linux Kernel List" Subject: RE: Swap size for a machine with 2GB of memory Date: Sun, 19 Aug 2001 19:05:08 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org I was just experimenting on my personal Linux computer this weekend, which has 512MB of RAM and 700MB of swap. I also have an unpatched 2.4.8 kernel installed. I wrote a program that allocated 700MB of RAM and touched every page, then read it back in. When finished, there remained 250+ meg of swap in use, but no corresponding free space in RAM, compared to before running my test program. The expected behavior of the 2.4 kernels seemed to be followed, where many programs retained space in both RAM and swap. However, since my normal behavior is for swap to not be used, I will wait a little bit for some of the VM updates to be tested. I don't have 2X RAM because when I installed my system, I only had 256MB of RAM. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Aug 2001 20:08:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Aug 2001 20:08:39 -0400 Received: from hera.cwi.nl ([192.16.191.8]:29369 "EHLO hera.cwi.nl") by vger.kernel.org with ESMTP id ; Sun, 19 Aug 2001 20:08:36 -0400 From: Andries.Brouwer@cwi.nl Date: Mon, 20 Aug 2001 00:08:40 GMT Message-Id: <200108200008.AAA157827@vlet.cwi.nl> To: ebiederm@xmission.com, esr@thyrsus.com, sct@redhat.com Subject: Re: Swap size for a machine with 2GB of memory Cc: gars@lanm-pc.com, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: ebiederm@xmission.com (Eric W. Biederman) Date: 19 Aug 2001 14:49:23 -0600 "Eric S. Raymond" writes: > The Red Hat installation manual claims that the size of the > swap partition should be twice the size of physical memory, > but no more than 128MB. > > Should I believe the above formula? You give two statements. The 128 MB bound was claimed by Microsoft and we screamed loudly that that was a lie - now it is claimed by both SuSE and RedHat. Funny. No, the bound is not 128 MB. See mkswap(8). With respect to swap partitions the current limit is about 64Gig. You can actually make a larger swap partition but the kernel on x86 only uses 24 offset bits into that partition. The 128MB partition existed but was removed long ago. Long ago I wrote in mkswap(8) that the max on i386 is about 2 GiB. I seem to recall that at some point in time the swap size in bytes had to fit in a signed long, and indeed, 2.1.117 has if (p->max >= 0x7fffffffL/PAGE_SIZE ... 2.2.0pre9 changed this into if (p->max >= SWP_OFFSET(SWP_ENTRY(0,~0UL))) deleting this restriction. If it is no longer there, I suppose I should change mkswap.c. Stephen, can you confirm? Andries From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Aug 2001 13:50:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Aug 2001 13:49:55 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:10798 "EHLO flinx.biederman.org") by vger.kernel.org with ESMTP id ; Mon, 20 Aug 2001 13:49:43 -0400 To: "Kevin Krieser" Cc: "Linux Kernel List" Subject: Re: Swap size for a machine with 2GB of memory In-Reply-To: From: ebiederm@xmission.com (Eric W. Biederman) Date: 20 Aug 2001 11:42:38 -0600 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org "Kevin Krieser" writes: > I was just experimenting on my personal Linux computer this weekend, which > has 512MB of RAM and 700MB of swap. I also have an unpatched 2.4.8 kernel > installed. > > I wrote a program that allocated 700MB of RAM and touched every page, then > read it back in. When finished, there remained 250+ meg of swap in use, but > no corresponding free space in RAM, compared to before running my test > program. The expected behavior of the 2.4 kernels seemed to be followed, > where many programs retained space in both RAM and swap. This was even the behavior in 2.0, and 2.2. 2.4 can simply be more aggressive about it. What this sounds like is that, your program pushed 250MB of other programs into swap. The programs were the reread into memory when it was done, and their location in swap was remembered so that if they were ever pushed into swap again they could just be dropped from memory, and not need to be written out. As long as you don't have problems where you can't run your program multiple times in a row, 2.4 sounds like is is behaving correctly and sanely. > However, since my normal behavior is for swap to not be used, I will wait a > little bit for some of the VM updates to be tested. Are you saying something is wrong? > I don't have 2X RAM because when I installed my system, I only had 256MB of > RAM. This is not a requirement but is a requirement to have swap > mem if you are swapping heavily and want good performance. Eric From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Aug 2001 19:09:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Aug 2001 19:09:46 -0400 Received: from ch-12-44-139-249.lcisp.com ([12.44.139.249]:36736 "HELO dual.lcisp.com") by vger.kernel.org with SMTP id ; Mon, 20 Aug 2001 19:09:33 -0400 From: "Kevin Krieser" To: "Eric W. Biederman" , "Kevin Krieser" Cc: "Linux Kernel List" Subject: RE: Swap size for a machine with 2GB of memory Date: Mon, 20 Aug 2001 18:09:38 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org I was just experimenting. 512MB is more than sufficient for my needs, I just couldn't bypass the $130 (at the time) for the memory which took me to 512MB. I've seen some later updates to the VM, but at the moment, the 2.4.8 kernel is working well for me. Better than the 2.4.6 kernel. -----Original Message----- From: eric@frodo.biederman.org [mailto:eric@frodo.biederman.org]On Behalf Of Eric W. Biederman Sent: Monday, August 20, 2001 12:43 PM To: Kevin Krieser Cc: Linux Kernel List Subject: Re: Swap size for a machine with 2GB of memory As long as you don't have problems where you can't run your program multiple times in a row, 2.4 sounds like is is behaving correctly and sanely. > However, since my normal behavior is for swap to not be used, I will wait a > little bit for some of the VM updates to be tested. Are you saying something is wrong? > I don't have 2X RAM because when I installed my system, I only had 256MB of > RAM. This is not a requirement but is a requirement to have swap > mem if you are swapping heavily and want good performance. Eric From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 21 Aug 2001 19:14:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 21 Aug 2001 19:14:13 -0400 Received: from etpmod.phys.tue.nl ([131.155.111.35]:36119 "EHLO etpmod.phys.tue.nl") by vger.kernel.org with ESMTP id ; Tue, 21 Aug 2001 19:14:04 -0400 Date: Wed, 22 Aug 2001 01:14:18 +0200 From: Kurt Garloff To: Andries.Brouwer@cwi.nl Cc: linux-kernel@vger.kernel.org Subject: Re: Swap size for a machine with 2GB of memory Message-ID: <20010822011418.A21379@gum01m.etpnet.phys.tue.nl> Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org In-Reply-To: <200108200008.AAA157827@vlet.cwi.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <200108200008.AAA157827@vlet.cwi.nl> User-Agent: Mutt/1.3.20i X-Operating-System: Linux 2.4.7 i686 X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 Organization: TU/e(NL), SuSE(DE) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 20, 2001 at 12:08:40AM +0000, Andries Brouwer wrote: > You give two statements. The 128 MB bound was claimed by Microsoft > and we screamed loudly that that was a lie - now it is claimed > by both SuSE and RedHat. Funny. Oops!=20 I found /usr/share/doc/packages/yast2/README.partitioner Embarassing; considering that YaST2 is newer then the end of this limit ... If you found more of them, please tell me, so it gets fixed. TiA! --=20 Kurt Garloff Eindhoven, NL GPG key: See mail header, key servers Linux kernel development SuSE GmbH, Nuernberg, DE SCSI, Security --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7gutJxmLh6hyYd04RAtZTAJ4/xi6UD/b8BhAI4VqNz/c7HEiKzQCfcxZn 2zlzNOO69s22UHZNM/0Grbc= =61s9 -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 24 Aug 2001 08:45:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 24 Aug 2001 08:45:15 -0400 Received: from 20dyn245.com21.casema.net ([213.17.90.245]:33298 "EHLO abraracourcix.bitwizard.nl") by vger.kernel.org with ESMTP id ; Fri, 24 Aug 2001 08:45:10 -0400 Message-Id: <200108241245.OAA31998@cave.bitwizard.nl> Subject: Re: Swap size for a machine with 2GB of memory In-Reply-To: <200108200008.AAA157827@vlet.cwi.nl> from "Andries.Brouwer@cwi.nl" at "Aug 20, 2001 00:08:40 am" To: Andries.Brouwer@cwi.nl Date: Fri, 24 Aug 2001 14:45:22 +0200 (MEST) CC: ebiederm@xmission.com, esr@thyrsus.com, sct@redhat.com, gars@lanm-pc.com, linux-kernel@vger.kernel.org From: R.E.Wolff@BitWizard.nl (Rogier Wolff) X-Mailer: ELM [version 2.4ME+ PL60 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Andries.Brouwer@cwi.nl wrote: > From: ebiederm@xmission.com (Eric W. Biederman) > Date: 19 Aug 2001 14:49:23 -0600 > > "Eric S. Raymond" writes: > > > The Red Hat installation manual claims that the size of the > > swap partition should be twice the size of physical memory, > > but no more than 128MB. > > > > Should I believe the above formula? > > You give two statements. The 128 MB bound was claimed by Microsoft > and we screamed loudly that that was a lie - now it is claimed > by both SuSE and RedHat. Funny. > No, the bound is not 128 MB. See mkswap(8). I think that red hat means: recoomended swap (machine) = min (128M, 2 * RAM(machine)); My personal recommendation is: recoomended swap (machine) = 2 * RAM(machine); (unless you know what you're doing). I run three machines with 0Mb swap: I know what I'm doing. If you know you're going to run VERY VERY large simulations which have sort of linear memory access patterns, it may pay to have LOTS more swap than normally recommended. Also, You spend just a few percent on "recommended swap" in relation to what you just spent on "RAM (machine)". So even if you're never going to use it, it's still usefull. Roger. -- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* * There are old pilots, and there are bold pilots. * There are also old, bald pilots.