1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Merge i386/machdep.c rev 1.472: Fix bug in physmem_est and maxbcache

calculation

Forgotten by: dillon
This commit is contained in:
Peter Wemm 2001-08-23 01:34:35 +00:00
parent 748e7247a1
commit 60e562536f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82159
2 changed files with 12 additions and 8 deletions

View File

@ -232,7 +232,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}.
@ -304,8 +304,10 @@ cpu_startup(dummy)
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.
@ -326,7 +328,7 @@ cpu_startup(dummy)
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

@ -232,7 +232,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}.
@ -304,8 +304,10 @@ cpu_startup(dummy)
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.
@ -326,7 +328,7 @@ cpu_startup(dummy)
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;
}