diff options
author | Jan Beulich <JBeulich@novell.com> | 2009-09-21 20:03:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:38 -0400 |
commit | 2c85f51d222ccdd8c401d77a36b723a89156810d (patch) | |
tree | fb94c6ea243504043e434f0a7d26cfd4831b33a9 /mm | |
parent | 3c1596efe167322dae87f8390d36f91ce2d7f936 (diff) |
mm: also use alloc_large_system_hash() for the PID hash table
This is being done by allowing boot time allocations to specify that they
may want a sub-page sized amount of memory.
Overall this seems more consistent with the other hash table allocations,
and allows making two supposedly mm-only variables really mm-only
(nr_{kernel,all}_pages).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 33b1a4762a7b..770f011e1c12 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -124,8 +124,8 @@ static char * const zone_names[MAX_NR_ZONES] = { | |||
124 | 124 | ||
125 | int min_free_kbytes = 1024; | 125 | int min_free_kbytes = 1024; |
126 | 126 | ||
127 | unsigned long __meminitdata nr_kernel_pages; | 127 | static unsigned long __meminitdata nr_kernel_pages; |
128 | unsigned long __meminitdata nr_all_pages; | 128 | static unsigned long __meminitdata nr_all_pages; |
129 | static unsigned long __meminitdata dma_reserve; | 129 | static unsigned long __meminitdata dma_reserve; |
130 | 130 | ||
131 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | 131 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP |
@@ -4821,7 +4821,14 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
4821 | numentries <<= (PAGE_SHIFT - scale); | 4821 | numentries <<= (PAGE_SHIFT - scale); |
4822 | 4822 | ||
4823 | /* Make sure we've got at least a 0-order allocation.. */ | 4823 | /* Make sure we've got at least a 0-order allocation.. */ |
4824 | if (unlikely((numentries * bucketsize) < PAGE_SIZE)) | 4824 | if (unlikely(flags & HASH_SMALL)) { |
4825 | /* Makes no sense without HASH_EARLY */ | ||
4826 | WARN_ON(!(flags & HASH_EARLY)); | ||
4827 | if (!(numentries >> *_hash_shift)) { | ||
4828 | numentries = 1UL << *_hash_shift; | ||
4829 | BUG_ON(!numentries); | ||
4830 | } | ||
4831 | } else if (unlikely((numentries * bucketsize) < PAGE_SIZE)) | ||
4825 | numentries = PAGE_SIZE / bucketsize; | 4832 | numentries = PAGE_SIZE / bucketsize; |
4826 | } | 4833 | } |
4827 | numentries = roundup_pow_of_two(numentries); | 4834 | numentries = roundup_pow_of_two(numentries); |