From owner-freebsd-arch Mon Oct 7 17:17:21 2002 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 AB14037B404 for ; Mon, 7 Oct 2002 17:17:20 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 531C843E88 for ; Mon, 7 Oct 2002 17:17:20 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g980H4PQ049579; Mon, 7 Oct 2002 17:17:04 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g980H3Dl049578; Mon, 7 Oct 2002 17:17:03 -0700 (PDT) (envelope-from dillon) Date: Mon, 7 Oct 2002 17:17:03 -0700 (PDT) From: Matthew Dillon Message-Id: <200210080017.g980H3Dl049578@apollo.backplane.com> To: Terry Lambert Cc: Wilko Bulte , Peter Wemm , Mikhail Teterin , arch@FreeBSD.ORG Subject: Re: swapon some regular file References: <20021007212545.C363B2A88D@canning.wemm.org> <3DA204A7.50530BE5@mindspring.com> <20021008000656.A598@freebie.xs4all.nl> <3DA20F40.D3C3FD59@mindspring.com> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The translation overhead isn't a major problem. What is a major problem is the fact that having to do a translation may require additional I/O's... in fact, may require additional memory allocations. Since pageouts usually occur when memory is low, the additional I/O can lead to a deadlock in the paging system. So the OS would definitely need to preallocate and record the physical block numbers / number ranges related to the new swap area. This is just as well since you can't safely use a sparse file to back the swap area anyway. Since pageouts are essentially random, the underlying file blocks would be allocated non deterministically and the result would be a mess of seeks and no ability to cluster anything. This is easy to demonstrate with VN. You can back a VN disk with a pre-allocated file, with a sparse file, with pre-reserved swap, or with sparse swap. The performance of VN disks created with sparse files or swap tend to degrade rather quickly due to the severe randomness in the seeking that winds up happening. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message