Revert order of formula to calculate the number of buffer pages if the
BUFCACHE option is defined. With the new formular a few pages less will be used (22 on a system with 256MB) but we avoid a possible integer overflow.
This commit is contained in:
parent
29eb489aa2
commit
0f8b4e4579
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_allocsys.c,v 1.7 1999/12/05 15:53:37 tron Exp $ */
|
||||
/* $NetBSD: kern_allocsys.c,v 1.8 1999/12/05 17:12:43 tron Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -165,7 +165,7 @@ allocsys(v, mdcallback)
|
||||
if (bufcache < 5 || bufcache > 95)
|
||||
panic("bufcache is out of range (%d)\n",
|
||||
bufcache);
|
||||
bufpages = physmem * bufcache / 100;
|
||||
bufpages = physmem / 100 * bufcache;
|
||||
|
||||
} else {
|
||||
if (physmem < btoc(2 * 1024 * 1024))
|
||||
|
Loading…
Reference in New Issue
Block a user