From owner-freebsd-arch@FreeBSD.ORG Fri Aug 1 01:47:52 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C493137B405 for ; Fri, 1 Aug 2003 01:47:52 -0700 (PDT) Received: from cirb503493.alcatel.com.au (c211-28-27-130.belrs2.nsw.optusnet.com.au [211.28.27.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 983C943F93 for ; Fri, 1 Aug 2003 01:47:50 -0700 (PDT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])h718lhgh044801; Fri, 1 Aug 2003 18:47:43 +1000 (EST) (envelope-from jeremyp@cirb503493.alcatel.com.au) Received: (from jeremyp@localhost) by cirb503493.alcatel.com.au (8.12.8/8.12.8/Submit) id h718lcCg044800; Fri, 1 Aug 2003 18:47:38 +1000 (EST) Date: Fri, 1 Aug 2003 18:47:38 +1000 From: Peter Jeremy To: Poul-Henning Kamp Message-ID: <20030801084737.GA44755@cirb503493.alcatel.com.au> References: <747.1059686371@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <747.1059686371@critter.freebsd.dk> User-Agent: Mutt/1.4.1i cc: arch@freebsd.org Subject: Re: headsup: swap_pager.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 08:47:53 -0000 On Thu, Jul 31, 2003 at 11:19:31PM +0200, Poul-Henning Kamp wrote: >Another thing is that striping does not belong in the swap_pager in >the first place, we have CCD and similar pieces of code for that. Can (does) the swap striping code gain any performance advantage by knowing more about the paging system I/O behaviour than a general purpose striping tool would? >The new layout will allocate the devices sequentially in the "virtual >swapdevice" and allocation will (for now) be round robin between >the devices. Later I would like to implement load based device >selection (ie: pick the device with the lowest recent average access >time). My gut feeling is that the paging allocation algorithm has room for improvement[1]. I'm not sure that allocating based on disk busyness is necessarily the right direction. AFAIK, FreeBSD frees the backing swap page if the page in memory is modified. This means that a backing page is written once and read probably a fairly small number of times. The allocation algorithm needs to optimise performance across both the write and subsequent read(s). Measuring disk busyness over a short period will tend to optimise the write allocation but have little impact on the reads. Using a longer period runs the risk that paging spikes can saturate a disk in the short term. >If disk striping is necessary for the disks used for swap-space, >do it with ccd(4) and call swapon on that. Is the intent to have the paging subsystem spread page allocations across the available space or preferentially allocate from one end? In the former case, I don't believe striping has any advantages over concatenation. (Though I believe the latter may improve paging performance in the case where only a small part of the swap space is in use - which is probably the most common case). Peter [1] Based on using X, Mozilla and OpenOffice simultaneously on a system with only 128MB RAM.