Compute PAGER_MAP_SIZE at runtime to avoid needlessly crippling large-

memory models for the benefit of small-memory models.

Uses a heuristic of min(onboard_ram_size/2, 16MB).
This commit is contained in:
scw 2001-04-29 07:53:56 +00:00
parent 89e9fc44d5
commit 81be7c00b7
2 changed files with 25 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vmparam.h,v 1.18 2001/04/14 16:02:24 scw Exp $ */
/* $NetBSD: vmparam.h,v 1.19 2001/04/29 07:53:57 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -58,9 +58,14 @@
#define PAGE_MASK (PAGE_SIZE - 1)
/*
* Need a small pager map for the benefit of low-memory models...
* Need a small pager map for the benefit of low-memory models.
* To avoid using a needlessly small value on larger memory models,
* this is calculated at runtime.
*/
#define PAGER_MAP_SIZE (4 * 1024 * 1024)
#ifndef PAGER_MAP_SIZE
extern int mvme68k_pager_map_size;
#define PAGER_MAP_SIZE ((vsize_t) mvme68k_pager_map_size)
#endif
/*
* USRTEXT is the start of the user text/data space, while USRSTACK

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.79 2001/04/24 04:31:04 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.80 2001/04/29 07:53:56 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -194,6 +194,13 @@ int mem_cluster_cnt;
int cpuspeed; /* only used for printing later */
int delay_divisor = 512; /* assume some reasonable value to start */
/*
* Since mvme68k boards can have anything from 4MB of onboard RAM, we
* would rather set the PAGER_MAP_SIZE at runtime based on the amount
* of onboard RAM.
*/
int mvme68k_pager_map_size;
/* Machine-dependent initialization routines. */
void mvme68k_init __P((void));
@ -215,6 +222,15 @@ mvme68k_init()
{
int i;
/*
* Set PAGER_MAP_SIZE to half the size of onboard RAM, up to a
* maximum of 16MB.
* (Note: Just use ps_end here since onboard RAM starts at 0x0)
*/
mvme68k_pager_map_size = phys_seg_list[0].ps_end / 2;
if (mvme68k_pager_map_size > (16 * 1024 * 1024))
mvme68k_pager_map_size = 16 * 1024 * 1024;
/*
* Tell the VM system about available physical memory.
*/