summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2007-06-16 04:57:06 +0000
committeralc <alc@FreeBSD.org>2007-06-16 04:57:06 +0000
commita8415c5a0d7d39fe501a93e2f31b2532cf6dfd91 (patch)
treed4adea7a0cd4062bbcbfbb6bc1a5a30eecf59d97 /sys/powerpc
parent98cd3abe8b02f0ae3d389eb9e6ecbf4bf39032f6 (diff)
downloadFreeBSD-src-a8415c5a0d7d39fe501a93e2f31b2532cf6dfd91.zip
FreeBSD-src-a8415c5a0d7d39fe501a93e2f31b2532cf6dfd91.tar.gz
Enable the new physical memory allocator.
This allocator uses a binary buddy system with a twist. First and foremost, this allocator is required to support the implementation of superpages. As a side effect, it enables a more robust implementation of contigmalloc(9). Moreover, this reimplementation of contigmalloc(9) eliminates the acquisition of Giant by contigmalloc(..., M_NOWAIT, ...). The twist is that this allocator tries to reduce the number of TLB misses incurred by accesses through a direct map to small, UMA-managed objects and page table pages. Roughly speaking, the physical pages that are allocated for such purposes are clustered together in the physical address space. The performance benefits vary. In the most extreme case, a uniprocessor kernel running on an Opteron, I measured an 18% reduction in system time during a buildworld. This allocator does not implement page coloring. The reason is that superpages have much the same effect. The contiguous physical memory allocation necessary for a superpage is inherently colored. Finally, the one caveat is that this allocator does not effectively support prezeroed pages. I hope this is temporary. On i386, this is a slight pessimization. However, on amd64, the beneficial effects of the direct-map optimization outweigh the ill effects. I speculate that this is true in general of machines with a direct map. Approved by: re
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/include/vmparam.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h
index 01a29b2..60e240c 100644
--- a/sys/powerpc/include/vmparam.h
+++ b/sys/powerpc/include/vmparam.h
@@ -109,9 +109,27 @@ struct pmap_physseg {
*/
#define VM_PHYSSEG_DENSE
+/*
+ * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
+ * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
+ * the pool from which physical pages for small UMA objects are
+ * allocated.
+ */
+#define VM_NFREEPOOL 2
+#define VM_FREEPOOL_DEFAULT 0
+#define VM_FREEPOOL_DIRECT 1
+
+/*
+ * Create one free page list.
+ */
#define VM_NFREELIST 1
#define VM_FREELIST_DEFAULT 0
+/*
+ * The largest allocation size is 4MB.
+ */
+#define VM_NFREEORDER 11
+
#ifndef VM_INITIAL_PAGEIN
#define VM_INITIAL_PAGEIN 16
#endif
OpenPOWER on IntegriCloud