PERFORCE change 96786 for review
Kip Macy
kmacy at FreeBSD.org
Sun May 7 21:19:30 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=96786
Change 96786 by kmacy at kmacy_storage:sun4v_rwbuf on 2006/05/07 21:19:03
limit the range that vm_page_alloc_contig can allocate from to work
around its poor handling of small memory ranges
scrub hash table when a process exits as a workaround for finding
entries in the hash that don't exist in the pv list
Affected files ...
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#25 edit
Differences ...
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#25 (text+ko) ====
@@ -180,7 +180,6 @@
uma_zone_set_obj(thzone, &thzone_obj, tte_hash_max);
}
-
tte_hash_t
tte_hash_kernel_create(vm_offset_t va, uint64_t size)
{
@@ -195,7 +194,6 @@
return th;
}
-
tte_hash_t
tte_hash_create(uint64_t context, uint64_t *scratchval)
{
@@ -212,17 +210,17 @@
m = NULL;
while (m == NULL) {
- m = vm_page_alloc_contig(HASH_SIZE, 2*PAGE_SIZE_4M,
- (1UL<<34), PAGE_SIZE, (1UL<<34));
+ m = vm_page_alloc_contig(HASH_SIZE, phys_avail[0],
+ phys_avail[1], PAGE_SIZE, (1UL<<34));
if (m == NULL) {
printf("vm_page_alloc_contig failed - waiting to retry\n");
VM_WAIT;
}
}
- for (i = 0, tm = m; i < HASH_SIZE; i++, tm++) {
+ for (i = 0, tm = m; i < HASH_SIZE; i++, tm++)
if ((tm->flags & PG_ZERO) == 0)
pmap_zero_page(tm);
- }
+
th->th_hashtable = (void *)TLB_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m));
m = NULL;
while (m == NULL) {
@@ -268,6 +266,9 @@
fh->thf_head.fh_free_head = 0;
if (th->th_entries != 0)
panic("%d remaining entries", th->th_entries);
+#ifndef DONT_SCRUB_ENTRIES
+ pmap_scrub_pages(TLB_DIRECT_TO_PHYS((vm_offset_t)th->th_hashtable), th->th_size*PAGE_SIZE);
+#endif
}
static __inline void
More information about the p4-projects
mailing list