diff options
author | David S. Miller <davem@davemloft.net> | 2018-06-26 08:07:17 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-26 08:07:17 +0900 |
commit | 9ff3b40e411c00870d1c29cd6b843fca7c4160ae (patch) | |
tree | 4d58943bf8907f5704ba004fd5383c0d7683c61f /arch/x86/mm/init_64.c | |
parent | 823819507095135b475a99048f0b0b6e75580fbc (diff) | |
parent | 6f0d349d922ba44e4348a17a78ea51b7135965b1 (diff) | |
download | linux-stable-9ff3b40e411c00870d1c29cd6b843fca7c4160ae.tar.gz |
Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r-- | arch/x86/mm/init_64.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 045f492d5f68..a688617c727e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1350,16 +1350,28 @@ int kern_addr_valid(unsigned long addr) /* Amount of ram needed to start using large blocks */ #define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30) +/* Adjustable memory block size */ +static unsigned long set_memory_block_size; +int __init set_memory_block_size_order(unsigned int order) +{ + unsigned long size = 1UL << order; + + if (size > MEM_SIZE_FOR_LARGE_BLOCK || size < MIN_MEMORY_BLOCK_SIZE) + return -EINVAL; + + set_memory_block_size = size; + return 0; +} + static unsigned long probe_memory_block_size(void) { unsigned long boot_mem_end = max_pfn << PAGE_SHIFT; unsigned long bz; - /* If this is UV system, always set 2G block size */ - if (is_uv_system()) { - bz = MAX_BLOCK_SIZE; + /* If memory block size has been set, then use it */ + bz = set_memory_block_size; + if (bz) goto done; - } /* Use regular block if RAM is smaller than MEM_SIZE_FOR_LARGE_BLOCK */ if (boot_mem_end < MEM_SIZE_FOR_LARGE_BLOCK) { |