From owner-freebsd-arch@FreeBSD.ORG Fri Aug 1 01:23:46 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 24E6937B401 for ; Fri, 1 Aug 2003 01:23:46 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49EF843FDD for ; Fri, 1 Aug 2003 01:23:44 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h718NcBG075867; Fri, 1 Aug 2003 01:23:38 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h718Nava075866; Fri, 1 Aug 2003 01:23:36 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Fri, 1 Aug 2003 01:23:36 -0700 From: David Schultz To: Poul-Henning Kamp Message-ID: <20030801082336.GA75619@HAL9000.homeunix.com> Mail-Followup-To: Poul-Henning Kamp , arch@freebsd.org 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> 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:23:46 -0000 On Thu, Jul 31, 2003, Poul-Henning Kamp wrote: > People who do not adjust NSWAPDEV to match their configuration spend > a lot of RAM on holding the radix bitmap which is 3/4 empty: > > critter phk> sysctl kern.malloc | grep -i swap > SWAP 2 753K 753K 2 64 > critter phk> pstat -s > Device 1K-blocks Used Avail Capacity > /dev/ad0s1b 1321312 0 1321312 0% > > This is because the radix bitmap gets allocated for the full > stripe width, but only one quarter of it is actually used. Static striping has many annoying limitations, but the memory footprint isn't so significant. If people cared enough, we could save a factor of 2 by fixing the bugs that were introduced when daddr_t became 64 bits, and a factor of 8 by tracking swap space in PAGE_SIZEd quantities instead of DEV_BSIZEd quantities. By comparison, more clever striping strategies probably have a higher memory footprint, but have better flexibility and performance. But since you just ripped out the debugging stuff for the radix tree bitmap, I'm guessing that your plan is to replace the bitmap with something else within the next few days anyway... > 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. > > > 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). > > If disk striping is necessary for the disks used for swap-space, > do it with ccd(4) and call swapon on that. Can you please describe how the interface between ccd(4) and the swap subsystem will work? I like this idea, but it isn't immediately obvious how you plan to implement striping based on load and dynamic addition and removal of swap space.