From owner-freebsd-hackers Sun Sep 30 1:49:32 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 3104837B40D for ; Sun, 30 Sep 2001 01:49:30 -0700 (PDT) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.4/8.11.4) with ESMTP id f8U8mvv00911; Sun, 30 Sep 2001 10:48:57 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Matt Dillon Cc: Vladimir Dozen , Wilko Bulte , Alfred Perlstein , hackers@FreeBSD.ORG Subject: Re: VM: dynamic swap remapping (patch) In-Reply-To: Your message of "Sun, 30 Sep 2001 00:52:54 PDT." <200109300752.f8U7qsj41649@earth.backplane.com> Date: Sun, 30 Sep 2001 10:48:57 +0200 Message-ID: <909.1001839737@critter> From: Poul-Henning Kamp 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 In message <200109300752.f8U7qsj41649@earth.backplane.com>, Matt Dillon writes: >: Second, application not always grows to 1G, most of the time it keeps >: as small as 500M ;). Why should we precommit 1G for 500M data? Doing >: multi-mmap memory management is additional pain. > > Even using file-backed memory is fairly trivial. You don't need to > do multi-mmap memory management or do any kernel tweaking. Just > reserve 1G and use a single mmap() and file per process. I once had a patch to phkmalloc() which backed all malloc'ed VM with hidden files in the users homedir. It was written to put the VM usage under QUOTA control, but it had many useful side effects as well. I can't seem to find it right now, but it is trivial to do: just replace the sbrk(2) with mmap(). Only downside is the needed filedescriptor which some shells don't like. -- 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message