From owner-freebsd-hackers Sun Sep 30 13:22:28 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 4E91A37B409 for ; Sun, 30 Sep 2001 13:22:24 -0700 (PDT) Received: (from dillon@localhost) by earth.backplane.com (8.11.6/8.11.2) id f8UKMNi44948; Sun, 30 Sep 2001 13:22:23 -0700 (PDT) (envelope-from dillon) Date: Sun, 30 Sep 2001 13:22:23 -0700 (PDT) From: Matt Dillon Message-Id: <200109302022.f8UKMNi44948@earth.backplane.com> To: Alfred Perlstein Cc: Poul-Henning Kamp , Vladimir Dozen , Wilko Bulte , hackers@FreeBSD.ORG Subject: Re: VM: dynamic swap remapping (patch) References: <909.1001839737@critter> <200109301959.f8UJxN544635@earth.backplane.com> <20010930150626.N59854@elvis.mu.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> :Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 :> :phk@FreeBSD.ORG | TCP/IP since RFC 956 :> :> I think the file descriptor problem can be solved easily... simply :> open the file, mmap() the entire 1G segment for this special application, :> and then close() the file. Then have sbrk() just eats out of the mapped :> segment. Alternatively sbrk() could open/mmap/close in large 1MB or 4MB :> segments, again leaving no file descriptors dangling. : :Won't that cause fragmentation? You're forgettng the need to :ftruncate or pre-zero the file unless that's been fixed. : :-- :-Alfred Perlstein [alfred@freebsd.org] You have to pre-zero the file. You can do it in reasonably-sized chunks (like 4M) without causing fragmentation. You *CANNOT* use ftruncate() to extend the file - that will virtually guarentee massive fragmentation. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message