From owner-cvs-all Tue Aug 21 0:13:24 2001 Delivered-To: cvs-all@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 8011737B40C; Tue, 21 Aug 2001 00:13:18 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.4/8.11.2) id f7L7D9d60995; Tue, 21 Aug 2001 00:13:09 -0700 (PDT) (envelope-from dillon) Date: Tue, 21 Aug 2001 00:13:09 -0700 (PDT) From: Matt Dillon Message-Id: <200108210713.f7L7D9d60995@earth.backplane.com> To: Bruce Evans Cc: Peter Wemm , , Subject: Re: cvs commit: src/sys/boot/common loader.8 src/sys/conf options src/sys/i386/i386 machdep.c src/sys/i386/include param.h src/sys/kern subr_param.c src/sys/sys buf.h src/sys/vm swap_pager.c References: <20010821141007.Y1177-100000@besplex.bde.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :is in bytes, so `physmem_est / BKVASIZE' is normally 0 and nbuf is adjusted :_up_ to maxbcache / BKVASIZE (default 12500) on almost all machines. On :a machine with 32MB of RAM, this caused severe thrashing, and eventually :hangs and a panic, after about 20MB of RAM was firmly allocated to buffers. This is the pre-existing code. It looks severely broken in general: /* * Discount the physical memory larger than the size of kernel_map * to avoid eating up all of KVA space. */ 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); since kernel_map->max_offset - min_offset is in bytes, and physmem is in pages. I'll change everything to pages. -Matt : :Index: machdep.c :=================================================================== :RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v :retrieving revision 1.470 :diff -u -1 -r1.470 machdep.c :--- machdep.c 20 Aug 2001 00:41:11 -0000 1.470 :+++ machdep.c 21 Aug 2001 00:57:50 -0000 :@@ -316,4 +314,3 @@ : nbuf += (physmem_est - 16384) * 2 / (factor * 5); :- :- if (maxbcache && nbuf > physmem_est / BKVASIZE) :+ if (maxbcache != 0 && nbuf > maxbcache / BKVASIZE) : nbuf = maxbcache / BKVASIZE; : :Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message