From owner-freebsd-current Mon Jan 20 03:40:29 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id DAA25593 for current-outgoing; Mon, 20 Jan 1997 03:40:29 -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 DAA25584; Mon, 20 Jan 1997 03:40:24 -0800 (PST) Received: (from dtc@localhost) by scrooge.ee.swin.oz.au (8.6.9/8.6.9) id WAA19921; Mon, 20 Jan 1997 22:42:29 +1100 From: Douglas Thomas Crosher Message-Id: <199701201142.WAA19921@scrooge.ee.swin.oz.au> Subject: Re: possible madvise MADV_FREE improvement To: dyson@FreeBSD.ORG Date: Mon, 20 Jan 1997 22:42:28 +1100 (EST) Cc: current@FreeBSD.ORG In-Reply-To: <199701200206.VAA00126@dyson.iquest.net> from "John S. Dyson" at Jan 19, 97 09:06:06 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Below is a patch which seems to improve madvise MADV_FREE; stops the > > 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, > without paging it out. If the contents are disposed of, of course, the > pages in the page range will be demand zeroed. > > John > dyson@freebsd.org Thanks for looking into it, it now seems to do a good job of avoiding unnecessary zero fills. However it still seems to do a lot of unnecessary page-ins. The case of m==NULL and object->type==OBJT_SWAP seems important, patch below. Regards Douglas Crosher -=-=- *** vm_object.c.orig.2 Mon Jan 20 16:28:46 1997 --- vm_object.c Mon Jan 20 22:22:32 1997 *************** *** 714,719 **** --- 714,726 ---- tpindex = pindex; shadowlookup: m = vm_page_lookup(tobject, tpindex); + if ( m==NULL && tobject->type == OBJT_SWAP + && advise==MADV_FREE ) + { + swap_pager_dmzspace(object, pindex, 1); + continue; + } + else if (m == NULL) { if (tobject->type != OBJT_DEFAULT) { continue;