From owner-freebsd-current Mon Jan 20 03:56:27 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id DAA26131 for current-outgoing; Mon, 20 Jan 1997 03:56:27 -0800 (PST) Received: from scrooge.ee.swin.oz.au (scrooge.ee.swin.oz.au [136.186.4.20]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id DAA26126 for ; Mon, 20 Jan 1997 03:56:24 -0800 (PST) Received: (from dtc@localhost) by scrooge.ee.swin.oz.au (8.6.9/8.6.9) id WAA19937; Mon, 20 Jan 1997 22:58:06 +1100 From: Douglas Thomas Crosher Message-Id: <199701201158.WAA19937@scrooge.ee.swin.oz.au> Subject: Re: possible madvise MADV_FREE improvement To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Mon, 20 Jan 1997 22:58:06 +1100 (EST) Cc: current@freebsd.org In-Reply-To: <199701200722.IAA13617@labinfo.iet.unipi.it> from "Luigi Rizzo" at Jan 20, 97 08:22:28 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > page-ins in the example recently posted. It also brings the call > > > closer to reliably zeroing the pages. > > > > > Thanks for the bug report, and I will be committing a fix in a little > > while (next hour or so) for the problem. Note that MADV_FREE does not > > guarantee that the page will be zeroed in any way. Specificially, MADV_FREE > > allows the system to optionally dispose of the contents of the page range, > > when does the system decide for disposing the pages, and wouldn't it be > nice (and easy to implement) to have an option to force this behaviour ? Check the function vm_object_madvise in sys/vm/vm_object.c, the logic is in there. I've had it working reliably zeroing pages in an anonymous mapped region backed only by swap; the code had been doing just this, but not reliably, until the recent improvements. With the recent improvements it's not too much more costly to have the application zero the page, then call madvise MADV_FREE. But be careful the memory is not backed by a vnode else it may be read from there, which caught me out at one point. Regards Douglas Crosher