From owner-freebsd-arch@FreeBSD.ORG Thu Jul 31 14:19:36 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 7034937B401 for ; Thu, 31 Jul 2003 14:19:36 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7AAF543FBD for ; Thu, 31 Jul 2003 14:19:35 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h6VLJWmE000748 for ; Thu, 31 Jul 2003 23:19:33 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: arch@freebsd.org From: Poul-Henning Kamp Date: Thu, 31 Jul 2003 23:19:31 +0200 Message-ID: <747.1059686371@critter.freebsd.dk> Subject: 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: Thu, 31 Jul 2003 21:19:36 -0000 I am in the process of changing the on-disk layout policy used by the swap_pager. Currently we have a compiled in max number of swap devices, and the virtual "swapdevice" is striped over these. 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. 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. This change will also remove the compiled in limit on the number of swapdevices, and may also increase the upper size limit for each swap device by a factor four. Casualties of this will the ability to get swap information out of kvm images. If this, contrary to current evidence is very important to us, we can reimplement it later. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.