Subject: Re: MACHINE_NONCONTIG
To: None <ws@kurt.tools.de>
From: Gordon W. Ross <gwr@mc.com>
List: tech-kern
Date: 02/28/1997 10:25:44
> Date: Fri, 28 Feb 1997 16:15:24 +0100
> From: ws@kurt.tools.de (Wolfgang Solfrank)

> > u_int
> > pmap_free_pages()
> > {
> > 	int bytes;
> > 
> > 	bytes = avail_end - avail_start;
> > 	return(atop(bytes));
> > }
> 
> This routine needn't return the total amount of free pages (albeit it doesn't
> hurt (much)), but only the amount that is still available.  So it's probably
> better to change the code to use avail_next instead of avail_start, i.e.:
> 
> u_int
> pmap_free_pages()
> {
> 	int bytes;
> 
> 	bytes = avail_end - avail_next;
> 	return(atop(bytes));
> }

The routine is only called once during VM initialization, so the
result will be exactly the same either way.

Gordon