From owner-freebsd-arch Mon Oct 7 15: 4:51 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 1EDB937B404 for ; Mon, 7 Oct 2002 15:04:50 -0700 (PDT) Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9EE043E75 for ; Mon, 7 Oct 2002 15:04:49 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0113.cvx22-bradley.dialup.earthlink.net ([209.179.198.113] helo=mindspring.com) by falcon.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17yfzY-0006C8-00; Mon, 07 Oct 2002 15:04:45 -0700 Message-ID: <3DA204A7.50530BE5@mindspring.com> Date: Mon, 07 Oct 2002 15:03:19 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Peter Wemm Cc: Mikhail Teterin , arch@FreeBSD.org Subject: Re: swapon some regular file References: <20021007212545.C363B2A88D@canning.wemm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Peter Wemm wrote: > > Users wishing to swap onto a local regular file have to go through the > > vnconfig/mdconfig gimnastics. Is that intentional? > > Yes, it is quite intentional. swap_pager doesn't have the code to do > logical to physical translation that file IO would require. And the > VOP_BMAP calls that do that add new complications, including an additional > place it can sleep or run out of memory. > > We can get away with it for swapping to a file over NFS because the remote > server does the translation, not us. > > In reality, what is required is some careful cut/paste of code from > vnode_pager to swap_pager to add the missing bits, and some care to deal > with the complications. > > vnconfig/mdconfig work because that basically adds the logical -> physical > translation step. I'd just as soon not have to mess with this though. It would be useful to be able to ask a file for its list of physical blocks on the underlying device, so that you could sort them into contiguous extents, and then use *those*, instead of eating the translation overhead, each time... -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message