Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Sep 2001 13:22:23 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Alfred Perlstein <bright@mu.org>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Vladimir Dozen <vladimir-dozen@mail.ru>, Wilko Bulte <wkb@freebie.xs4all.nl>, hackers@FreeBSD.ORG
Subject:   Re: VM: dynamic swap remapping (patch)
Message-ID:  <200109302022.f8UKMNi44948@earth.backplane.com>
References:  <909.1001839737@critter> <200109301959.f8UJxN544635@earth.backplane.com> <20010930150626.N59854@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
:> :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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109302022.f8UKMNi44948>