summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2005-11-06 16:10:28 +0000
committercognet <cognet@FreeBSD.org>2005-11-06 16:10:28 +0000
commit37615e7c347ed85668546697970fe8b433e40e6d (patch)
tree4d75c9f98a225da2cef1dc4d9a05f254594a723d
parentf245873d1baab619f4b960bf7b69c44f85ab3293 (diff)
downloadFreeBSD-src-37615e7c347ed85668546697970fe8b433e40e6d.zip
FreeBSD-src-37615e7c347ed85668546697970fe8b433e40e6d.tar.gz
MFi386 rev 1.536 (sort of)
Move what can be moved (UMA zones creation, pv_entry_* initialization) from pmap_init2() to pmap_init(). Create a new function, pmap_postinit(), called from cpu_startup(), to do the L1 tables allocation. pmap_init2() is now empty for arm as well.
-rw-r--r--sys/arm/arm/machdep.c1
-rw-r--r--sys/arm/arm/pmap.c51
-rw-r--r--sys/arm/include/pmap.h2
3 files changed, 24 insertions, 30 deletions
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 1e9f5b1..04d3c31 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -244,6 +244,7 @@ cpu_startup(void *dummy)
cpu_setup("");
identify_arm_cpu();
thread0.td_frame = (struct trapframe *)pcb->un_32.pcb32_sp - 1;
+ pmap_postinit();
#ifdef ARM_CACHE_LOCK_ENABLE
pmap_kenter_user(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
arm_lock_cache_line(ARM_TP_ADDRESS);
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index 3079980..c782e79 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -398,11 +398,6 @@ int pmap_needs_pte_sync;
*/
#define PV_BEEN_REFD(f) (((f) & PVF_REF) != 0)
-/*
- * Data for the pv entry allocation mechanism
- */
-#define MINPV 2048
-
#ifndef PMAP_SHPGPERPROC
#define PMAP_SHPGPERPROC 200
#endif
@@ -1949,6 +1944,7 @@ pmap_page_init(vm_page_t m)
void
pmap_init(void)
{
+ int shpgperproc = PMAP_SHPGPERPROC;
PDEBUG(1, printf("pmap_init: phys_start = %08x\n"));
@@ -1957,12 +1953,24 @@ pmap_init(void)
*/
pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL,
NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
- uma_prealloc(pvzone, MINPV);
/*
* Now it is safe to enable pv_table recording.
*/
PDEBUG(1, printf("pmap_init: done!\n"));
+ TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
+
+ pv_entry_max = shpgperproc * maxproc + vm_page_array_size;
+ pv_entry_high_water = 9 * (pv_entry_max / 10);
+ l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor,
+ NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
+ l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable),
+ NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
+ UMA_ZONE_VM | UMA_ZONE_NOFREE);
+
+ uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
+ uma_zone_set_obj(l2zone, &l2zone_obj, pv_entry_max);
+
}
int
@@ -2190,15 +2198,14 @@ out:
return (rv);
}
-/*
- * Initialize the address space (zone) for the pv_entries. Set a
- * high water mark so that the system can recover from excessive
- * numbers of pv entries.
- */
void
-pmap_init2()
+pmap_init2(void)
+{
+}
+
+void
+pmap_postinit(void)
{
- int shpgperproc = PMAP_SHPGPERPROC;
struct l2_bucket *l2b;
struct l1_ttable *l1;
pd_entry_t *pl1pt;
@@ -2206,21 +2213,6 @@ pmap_init2()
vm_offset_t va, eva;
u_int loop, needed;
- TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
-
- pv_entry_max = shpgperproc * maxproc + vm_page_array_size;
- pv_entry_high_water = 9 * (pv_entry_max / 10);
- l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor,
- NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
- uma_prealloc(l2zone, 4096);
- l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable),
- NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
- UMA_ZONE_VM | UMA_ZONE_NOFREE);
- uma_prealloc(l2table_zone, 1024);
-
- uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
- uma_zone_set_obj(l2zone, &l2zone_obj, pv_entry_max);
-
needed = (maxproc / PMAP_DOMAINS) + ((maxproc % PMAP_DOMAINS) ? 1 : 0);
needed -= 1;
l1 = malloc(sizeof(*l1) * needed, M_VMPMAP, M_WAITOK);
@@ -3787,8 +3779,7 @@ pmap_get_pv_entry(void)
pv_entry_t ret_value;
pv_entry_count++;
- if (pv_entry_high_water &&
- (pv_entry_count > pv_entry_high_water) &&
+ if ((pv_entry_count > pv_entry_high_water) &&
(pmap_pagedaemon_waken == 0)) {
pmap_pagedaemon_waken = 1;
wakeup (&vm_pages_needed);
diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h
index 1974f91..dedce0d 100644
--- a/sys/arm/include/pmap.h
+++ b/sys/arm/include/pmap.h
@@ -509,6 +509,8 @@ void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags);
extern char *_tmppt;
+void pmap_postinit(void);
+
#ifdef ARM_USE_SMALL_ALLOC
void arm_add_smallalloc_pages(void *, void *, int, int);
void arm_busy_pages(void);
OpenPOWER on IntegriCloud