Fix bug in physmem_est calculation - the kernel_map size was not being

converted into pages.

Fix bug in maxbcache calculation, nbuf must be tested against maxbcache
rather then physmem_est.

Obtained from:	bde
This commit is contained in:
Matthew Dillon 2001-08-21 07:20:06 +00:00
parent f36b6e4bbb
commit 6db5812aef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82031
2 changed files with 12 additions and 10 deletions

View File

@ -219,7 +219,7 @@ cpu_startup(dummy)
vm_size_t size = 0;
int firstaddr;
vm_offset_t minaddr;
int physmem_est;
int physmem_est; /* in pages */
/*
* Good {morning,afternoon,evening,night}.
@ -293,9 +293,10 @@ again:
if (kernel_map->first_free == NULL) {
printf("Warning: no free entries in kernel_map.\n");
physmem_est = physmem;
} else
physmem_est = min(physmem, kernel_map->max_offset -
kernel_map->min_offset);
} else {
physmem_est = min(physmem, btoc(kernel_map->max_offset -
kernel_map->min_offset));
}
/*
* The nominal buffer size (and minimum KVA allocation) is BKVASIZE.
@ -317,7 +318,7 @@ again:
if (physmem_est > 16384)
nbuf += (physmem_est - 16384) * 2 / (factor * 5);
if (maxbcache && nbuf > physmem_est / BKVASIZE)
if (maxbcache && nbuf > maxbcache / BKVASIZE)
nbuf = maxbcache / BKVASIZE;
}

View File

@ -219,7 +219,7 @@ cpu_startup(dummy)
vm_size_t size = 0;
int firstaddr;
vm_offset_t minaddr;
int physmem_est;
int physmem_est; /* in pages */
/*
* Good {morning,afternoon,evening,night}.
@ -293,9 +293,10 @@ again:
if (kernel_map->first_free == NULL) {
printf("Warning: no free entries in kernel_map.\n");
physmem_est = physmem;
} else
physmem_est = min(physmem, kernel_map->max_offset -
kernel_map->min_offset);
} else {
physmem_est = min(physmem, btoc(kernel_map->max_offset -
kernel_map->min_offset));
}
/*
* The nominal buffer size (and minimum KVA allocation) is BKVASIZE.
@ -317,7 +318,7 @@ again:
if (physmem_est > 16384)
nbuf += (physmem_est - 16384) * 2 / (factor * 5);
if (maxbcache && nbuf > physmem_est / BKVASIZE)
if (maxbcache && nbuf > maxbcache / BKVASIZE)
nbuf = maxbcache / BKVASIZE;
}