1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Clean-up of the new buffer kva allocation code. Also, there was an

error in the !BOUNCE_BUFFERS case.
This commit is contained in:
John Dyson 1996-12-05 04:28:52 +00:00
parent 15dd4190ed
commit 3596818baa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=20146
4 changed files with 20 additions and 15 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.215 1996/12/01 15:46:40 dyson Exp $
* $Id: machdep.c,v 1.216 1996/12/01 16:34:05 bde Exp $
*/
#include "npx.h"
@ -282,7 +282,7 @@ cpu_startup(dummy)
if (nbuf == 0) {
nbuf = 30;
if( physmem > 1024)
nbuf += min((physmem - 1024) / 6, 2048);
nbuf += min((physmem - 1024) / 4, 1536);
}
nswbuf = max(min(nbuf/4, 128), 16);
@ -322,15 +322,15 @@ cpu_startup(dummy)
#ifdef BOUNCE_BUFFERS
clean_map = kmem_suballoc(kernel_map, &clean_sva, &clean_eva,
(3*nbuf*DFLTBSIZE/2) + (nswbuf*MAXPHYS) +
(nbuf*BKVASIZE) + (nswbuf*MAXPHYS) +
maxbkva + pager_map_size, TRUE);
io_map = kmem_suballoc(clean_map, &minaddr, &maxaddr, maxbkva, FALSE);
#else
clean_map = kmem_suballoc(kernel_map, &clean_sva, &clean_eva,
(nbuf*MAXBSIZE) + (nswbuf*MAXPHYS) + pager_map_size, TRUE);
(nbuf*BKVASIZE) + (nswbuf*MAXPHYS) + pager_map_size, TRUE);
#endif
buffer_map = kmem_suballoc(clean_map, &buffer_sva, &buffer_eva,
(3*nbuf*DFLTBSIZE/2), TRUE);
(nbuf*BKVASIZE), TRUE);
pager_map = kmem_suballoc(clean_map, &pager_sva, &pager_eva,
(nswbuf*MAXPHYS) + pager_map_size, TRUE);
exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.215 1996/12/01 15:46:40 dyson Exp $
* $Id: machdep.c,v 1.216 1996/12/01 16:34:05 bde Exp $
*/
#include "npx.h"
@ -282,7 +282,7 @@ cpu_startup(dummy)
if (nbuf == 0) {
nbuf = 30;
if( physmem > 1024)
nbuf += min((physmem - 1024) / 6, 2048);
nbuf += min((physmem - 1024) / 4, 1536);
}
nswbuf = max(min(nbuf/4, 128), 16);
@ -322,15 +322,15 @@ cpu_startup(dummy)
#ifdef BOUNCE_BUFFERS
clean_map = kmem_suballoc(kernel_map, &clean_sva, &clean_eva,
(3*nbuf*DFLTBSIZE/2) + (nswbuf*MAXPHYS) +
(nbuf*BKVASIZE) + (nswbuf*MAXPHYS) +
maxbkva + pager_map_size, TRUE);
io_map = kmem_suballoc(clean_map, &minaddr, &maxaddr, maxbkva, FALSE);
#else
clean_map = kmem_suballoc(kernel_map, &clean_sva, &clean_eva,
(nbuf*MAXBSIZE) + (nswbuf*MAXPHYS) + pager_map_size, TRUE);
(nbuf*BKVASIZE) + (nswbuf*MAXPHYS) + pager_map_size, TRUE);
#endif
buffer_map = kmem_suballoc(clean_map, &buffer_sva, &buffer_eva,
(3*nbuf*DFLTBSIZE/2), TRUE);
(nbuf*BKVASIZE), TRUE);
pager_map = kmem_suballoc(clean_map, &pager_sva, &pager_eva,
(nswbuf*MAXPHYS) + pager_map_size, TRUE);
exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,

View File

@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
* $Id: vfs_bio.c,v 1.107 1996/11/30 22:41:40 dyson Exp $
* $Id: vfs_bio.c,v 1.108 1996/12/01 15:46:31 dyson Exp $
*/
/*
@ -154,7 +154,7 @@ bufinit()
* cache is still the same as it would be for 8K filesystems. This
* keeps the size of the buffer cache "in check" for big block filesystems.
*/
maxbufspace = (nbuf + 8) * PAGE_SIZE;
maxbufspace = (nbuf + 8) * DFLTBSIZE;
/*
* reserve 1/3 of the buffers for metadata (VDIR) which might not be VMIO'ed
*/

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)param.h 8.3 (Berkeley) 4/4/95
* $Id: param.h,v 1.17 1996/11/30 22:41:35 dyson Exp $
* $Id: param.h,v 1.18 1996/12/04 11:30:40 jkh Exp $
*/
#ifndef _SYS_PARAM_H_
@ -144,10 +144,15 @@
* primarily determines the size of buffers in the buffer pool. It may be
* made larger without any effect on existing file systems; however making
* it smaller make make some file systems unmountable. Also, MAXBSIZE
* must be less than MAXPHYS!!!
* must be less than MAXPHYS!!! DFLTBSIZE is the average amount of
* memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount
* of kernel virtual space allocated per nbuf. BKVASIZE should be >=
* DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then
* kva fragmentation causes fewer performance problems.
*/
#define MAXBSIZE 65536
#define DFLTBSIZE 8192
#define BKVASIZE 8192
#define DFLTBSIZE 4096
#define MAXFRAG 8
/*