diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2007-05-17 14:25:00 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2007-05-17 14:25:00 +0000 |
commit | 686419a8e2d9acad83f5c367ed0d780d2f292670 (patch) | |
tree | dc6752f357bea60daff5ee83ffbe5bebe49795b4 | |
parent | d450e21d04e582a404a183715984043e1cf8ecfc (diff) |
Limit hppa buffer cache to 30%. It used to be 70% because stack garbage
that was used for minaddr instead of the proper vm_map_min(kernel_map)
(fixed in this diff).
From mickey. art@ ok
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index cb3fe60b1f5..1a531b330f7 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.152 2007/05/14 19:54:21 martin Exp $ */ +/* $OpenBSD: machdep.c,v 1.153 2007/05/17 14:24:59 art Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -387,11 +387,11 @@ hppa_init(start) if (nbuf == 0) nbuf = bufpages < 16? 16 : bufpages; - /* Restrict to at most 70% filled kvm */ + /* Restrict to at most 30% filled kvm */ if (nbuf * MAXBSIZE > - (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 7 / 10) + (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 3 / 10) nbuf = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / - MAXBSIZE * 7 / 10; + MAXBSIZE * 3 / 10; /* More buffer pages than fits into the buffers is senseless. */ if (bufpages > nbuf * MAXBSIZE / PAGE_SIZE) @@ -658,8 +658,9 @@ cpu_startup(void) ctob(physmem), ctob(resvmem), ctob(resvphysmem - resvmem)); size = MAXBSIZE * nbuf; + minaddr = vm_map_min(kernel_map); if (uvm_map(kernel_map, &minaddr, round_page(size), - NULL, UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(UVM_PROT_NONE, + NULL, UVM_UNKNOWN_OFFSET, PAGE_SIZE, UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE, UVM_ADV_NORMAL, 0))) panic("cpu_startup: cannot allocate VM for buffers"); buffers = (caddr_t)minaddr; |