Date: Mon, 20 Jan 1997 22:42:28 +1100 (EST) From: Douglas Thomas Crosher <dtc@scrooge.ee.swin.oz.au> To: dyson@FreeBSD.ORG Cc: current@FreeBSD.ORG Subject: Re: possible madvise MADV_FREE improvement Message-ID: <199701201142.WAA19921@scrooge.ee.swin.oz.au> In-Reply-To: <199701200206.VAA00126@dyson.iquest.net> from "John S. Dyson" at Jan 19, 97 09:06:06 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701201142.WAA19921>
