|
@@ -6940,6 +6940,17 @@ static int __init set_hashdist(char *str)
|
|
|
__setup("hashdist=", set_hashdist);
|
|
|
#endif
|
|
|
|
|
|
+#ifndef __HAVE_ARCH_RESERVED_KERNEL_PAGES
|
|
|
+/*
|
|
|
+ * Returns the number of pages that arch has reserved but
|
|
|
+ * is not known to alloc_large_system_hash().
|
|
|
+ */
|
|
|
+static unsigned long __init arch_reserved_kernel_pages(void)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
* allocate a large system hash table from bootmem
|
|
|
* - it is assumed that the hash table must contain an exact power-of-2
|
|
@@ -6964,6 +6975,7 @@ void *__init alloc_large_system_hash(const char *tablename,
|
|
|
if (!numentries) {
|
|
|
/* round applicable memory size up to nearest megabyte */
|
|
|
numentries = nr_kernel_pages;
|
|
|
+ numentries -= arch_reserved_kernel_pages();
|
|
|
|
|
|
/* It isn't necessary when PAGE_SIZE >= 1MB */
|
|
|
if (PAGE_SHIFT < 20)
|