Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 1 Nov 2002 19:40:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 1 Nov 2002 19:40:38 -0500 Received: from vasquez.zip.com.au ([203.12.97.41]:49412 "EHLO vasquez.zip.com.au") by vger.kernel.org with ESMTP id ; Fri, 1 Nov 2002 19:40:36 -0500 Message-ID: <3DC3207A.450402B3@zip.com.au> Date: Fri, 01 Nov 2002 16:46:50 -0800 From: Andrew Morton X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.19-pre4 i686) X-Accept-Language: en MIME-Version: 1.0 To: Dave Jones CC: "Randy.Dunlap" , linux-kernel@vger.kernel.org Subject: Re: [announce] swap mini-howto References: <20021102000907.GA9229@suse.de> 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 Content-Length: 1688 Lines: 41 Dave Jones wrote: > > Might be nice to mention that using multiple swap partitions > on different disks will 'stripe' requests across disks a-la-raid0 > Yup. Something I'd like to point out here: in 2.4 and earlier, swapfiles are less robust than swap devices - the need to go and read metadata from the filesystem made them prone to oom deadlocks allocating pages and buffer_heads with which to perform the swapout. That has changed in 2.5. Swapping onto a regular file has no disadvantage wrt swapping onto a block device. The kernel does not need to allocate any memory at all to get a swapcache page onto disk. Which is interesting. Because swapfiles are much easier to administer, and much easier to stripe. Adding, removing and resizing is simplified. Distributors of 2.6-based kernels could consider doing away with swapdevs altogether. If you have two disks then it is very sensible to create a swapfile on each one and to perform an equal-priority stripe between them. This will give the best raw swap IO bandwidth. But it could cause additional seeking between swap and regular file data. Dedicating an entire disk to swap will obviously reduce the seeking problem. But really, if your application is dependent on swap performance, you need more RAM. Swap should be viewed as a lightweight background optimisation to make unused pages available for other work, rather than as a cure for an underprovisioned machine. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/