mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
Changed buffer allocation policy (machdep.c)
Moved various pmap 'bit' test/set functions back into real functions; gcc generates better code at the expense of more of it. (pmap.c) Fixed a deadlock problem with pv entry allocations (pmap.c) Added a new, optional function 'pmap_prefault' that does clustered page table preloading (pmap.c) Changed the way that page tables are held onto (trap.c). Submitted by: John Dyson
This commit is contained in:
parent
0a1c0d9ae8
commit
fbdfe8ac22
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5837
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.101 1995/01/14 13:20:08 bde Exp $
|
||||
* $Id: machdep.c,v 1.102 1995/01/17 01:15:12 bde Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -114,7 +114,7 @@ char cpu_model[sizeof("Cy486DLC") + 1];
|
||||
/*
|
||||
* Declare these as initialized data so we can patch them.
|
||||
*/
|
||||
int nswbuf = 128;
|
||||
int nswbuf = 0;
|
||||
#ifdef NBUF
|
||||
int nbuf = NBUF;
|
||||
#else
|
||||
@ -255,9 +255,12 @@ cpu_startup()
|
||||
valloc(msqids, struct msqid_ds, msginfo.msgmni);
|
||||
#endif
|
||||
|
||||
if (nbuf == 0)
|
||||
nbuf = min(physmem / 30, 256);
|
||||
nswbuf = nbuf;
|
||||
if (nbuf == 0) {
|
||||
nbuf = 32;
|
||||
if( physmem > 1024)
|
||||
nbuf += min((physmem - 1024) / 20, 1024);
|
||||
}
|
||||
nswbuf = min(nbuf, 128);
|
||||
|
||||
valloc(swbuf, struct buf, nswbuf);
|
||||
valloc(buf, struct buf, nbuf);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.43 1995/01/09 16:04:39 davidg Exp $
|
||||
* $Id: trap.c,v 1.44 1995/01/14 13:20:10 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -460,23 +460,12 @@ trap_pfault(frame, usermode)
|
||||
/* Fault the pte only if needed: */
|
||||
*(volatile char *)v += 0;
|
||||
|
||||
ptepg = (vm_page_t) pmap_pte_vm_page(vm_map_pmap(map), v);
|
||||
vm_page_hold(ptepg);
|
||||
pmap_use_pt( vm_map_pmap(map), va);
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
|
||||
vm_page_unhold(ptepg);
|
||||
|
||||
/*
|
||||
* page table pages don't need to be kept if they
|
||||
* are not held
|
||||
*/
|
||||
if( ptepg->hold_count == 0 && ptepg->wire_count == 0) {
|
||||
pmap_page_protect( VM_PAGE_TO_PHYS(ptepg),
|
||||
VM_PROT_NONE);
|
||||
vm_page_free(ptepg);
|
||||
}
|
||||
pmap_unuse_pt( vm_map_pmap(map), va);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.101 1995/01/14 13:20:08 bde Exp $
|
||||
* $Id: machdep.c,v 1.102 1995/01/17 01:15:12 bde Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -114,7 +114,7 @@ char cpu_model[sizeof("Cy486DLC") + 1];
|
||||
/*
|
||||
* Declare these as initialized data so we can patch them.
|
||||
*/
|
||||
int nswbuf = 128;
|
||||
int nswbuf = 0;
|
||||
#ifdef NBUF
|
||||
int nbuf = NBUF;
|
||||
#else
|
||||
@ -255,9 +255,12 @@ cpu_startup()
|
||||
valloc(msqids, struct msqid_ds, msginfo.msgmni);
|
||||
#endif
|
||||
|
||||
if (nbuf == 0)
|
||||
nbuf = min(physmem / 30, 256);
|
||||
nswbuf = nbuf;
|
||||
if (nbuf == 0) {
|
||||
nbuf = 32;
|
||||
if( physmem > 1024)
|
||||
nbuf += min((physmem - 1024) / 20, 1024);
|
||||
}
|
||||
nswbuf = min(nbuf, 128);
|
||||
|
||||
valloc(swbuf, struct buf, nswbuf);
|
||||
valloc(buf, struct buf, nbuf);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.43 1995/01/09 16:04:39 davidg Exp $
|
||||
* $Id: trap.c,v 1.44 1995/01/14 13:20:10 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -460,23 +460,12 @@ trap_pfault(frame, usermode)
|
||||
/* Fault the pte only if needed: */
|
||||
*(volatile char *)v += 0;
|
||||
|
||||
ptepg = (vm_page_t) pmap_pte_vm_page(vm_map_pmap(map), v);
|
||||
vm_page_hold(ptepg);
|
||||
pmap_use_pt( vm_map_pmap(map), va);
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
|
||||
vm_page_unhold(ptepg);
|
||||
|
||||
/*
|
||||
* page table pages don't need to be kept if they
|
||||
* are not held
|
||||
*/
|
||||
if( ptepg->hold_count == 0 && ptepg->wire_count == 0) {
|
||||
pmap_page_protect( VM_PAGE_TO_PHYS(ptepg),
|
||||
VM_PROT_NONE);
|
||||
vm_page_free(ptepg);
|
||||
}
|
||||
pmap_unuse_pt( vm_map_pmap(map), va);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.43 1995/01/09 16:04:39 davidg Exp $
|
||||
* $Id: trap.c,v 1.44 1995/01/14 13:20:10 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -460,23 +460,12 @@ trap_pfault(frame, usermode)
|
||||
/* Fault the pte only if needed: */
|
||||
*(volatile char *)v += 0;
|
||||
|
||||
ptepg = (vm_page_t) pmap_pte_vm_page(vm_map_pmap(map), v);
|
||||
vm_page_hold(ptepg);
|
||||
pmap_use_pt( vm_map_pmap(map), va);
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
|
||||
vm_page_unhold(ptepg);
|
||||
|
||||
/*
|
||||
* page table pages don't need to be kept if they
|
||||
* are not held
|
||||
*/
|
||||
if( ptepg->hold_count == 0 && ptepg->wire_count == 0) {
|
||||
pmap_page_protect( VM_PAGE_TO_PHYS(ptepg),
|
||||
VM_PROT_NONE);
|
||||
vm_page_free(ptepg);
|
||||
}
|
||||
pmap_unuse_pt( vm_map_pmap(map), va);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user