aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authorAlfredo Dal'Ava Junior <alfredo@FreeBSD.org>2020-04-15 20:33:09 +0000
committerAlfredo Dal'Ava Junior <alfredo@FreeBSD.org>2020-04-15 20:33:09 +0000
commitd80a9248224e8f80d9b4798297e6151e6d37ac87 (patch)
tree5712b0d328bc37a0bba7b2953ec35b5414447f79 /sys/powerpc/aim
parent3076591b7a92f9359d297bef555f4f9f62e9d8f7 (diff)
downloadsrc-d80a9248224e8f80d9b4798297e6151e6d37ac87.tar.gz
src-d80a9248224e8f80d9b4798297e6151e6d37ac87.zip
powerpc: autosize bpvo based on physical memory
Default moea64_bpvo_pool_size 327680 was insufficient for initial memory mapping at boot time on systems with, for example, 64G and no huge pages enabled. Submitted by: Andre Silva <afscoelho@gmail.com> Reviewed by: jhibbits, alfredo Approved by: jhibbits (mentor) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D24102
Notes
Notes: svn path=/head/; revision=359992
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/mmu_oea64.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c
index 3bb0880978de..82d38d2f70ea 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/vmmeter.h>
#include <sys/smp.h>
+#include <sys/reboot.h>
#include <sys/kdb.h>
@@ -184,10 +185,12 @@ uma_zone_t moea64_pvo_zone; /* zone for pvo entries */
static struct pvo_entry *moea64_bpvo_pool;
static int moea64_bpvo_pool_index = 0;
-static int moea64_bpvo_pool_size = 327680;
+static int moea64_bpvo_pool_size = 0;
SYSCTL_INT(_machdep, OID_AUTO, moea64_allocated_bpvo_entries, CTLFLAG_RD,
&moea64_bpvo_pool_index, 0, "");
+#define BPVO_POOL_SIZE 327680 /* Sensible historical default value */
+#define BPVO_POOL_EXPANSION_FACTOR 3
#define VSID_NBPW (sizeof(u_int32_t) * 8)
#ifdef __powerpc64__
#define NVSIDS (NPMAPS * 16)
@@ -916,6 +919,20 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
* Initialise the bootstrap pvo pool.
*/
TUNABLE_INT_FETCH("machdep.moea64_bpvo_pool_size", &moea64_bpvo_pool_size);
+ if (moea64_bpvo_pool_size == 0) {
+ if (!hw_direct_map)
+ moea64_bpvo_pool_size = ((ptoa((uintmax_t)physmem) * sizeof(struct vm_page)) /
+ (PAGE_SIZE * PAGE_SIZE)) * BPVO_POOL_EXPANSION_FACTOR;
+ else
+ moea64_bpvo_pool_size = BPVO_POOL_SIZE;
+ }
+
+ if (boothowto & RB_VERBOSE) {
+ printf("mmu_oea64: bpvo pool entries = %d, bpvo pool size = %ju MB\n",
+ moea64_bpvo_pool_size,
+ moea64_bpvo_pool_size*sizeof(struct pvo_entry) / 1048576);
+ }
+
moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc(
moea64_bpvo_pool_size*sizeof(struct pvo_entry), PAGE_SIZE);
moea64_bpvo_pool_index = 0;