diff options
| -rw-r--r-- | arch/x86/mm/init_64.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index f35c66c5959a..b92591fa8970 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
| @@ -1230,17 +1230,43 @@ const char *arch_vma_name(struct vm_area_struct *vma) | |||
| 1230 | return NULL; | 1230 | return NULL; |
| 1231 | } | 1231 | } |
| 1232 | 1232 | ||
| 1233 | #ifdef CONFIG_X86_UV | 1233 | static unsigned long probe_memory_block_size(void) |
| 1234 | unsigned long memory_block_size_bytes(void) | ||
| 1235 | { | 1234 | { |
| 1235 | /* start from 2g */ | ||
| 1236 | unsigned long bz = 1UL<<31; | ||
| 1237 | |||
| 1238 | #ifdef CONFIG_X86_UV | ||
| 1236 | if (is_uv_system()) { | 1239 | if (is_uv_system()) { |
| 1237 | printk(KERN_INFO "UV: memory block size 2GB\n"); | 1240 | printk(KERN_INFO "UV: memory block size 2GB\n"); |
| 1238 | return 2UL * 1024 * 1024 * 1024; | 1241 | return 2UL * 1024 * 1024 * 1024; |
| 1239 | } | 1242 | } |
| 1240 | return MIN_MEMORY_BLOCK_SIZE; | ||
| 1241 | } | ||
| 1242 | #endif | 1243 | #endif |
| 1243 | 1244 | ||
| 1245 | /* less than 64g installed */ | ||
| 1246 | if ((max_pfn << PAGE_SHIFT) < (16UL << 32)) | ||
| 1247 | return MIN_MEMORY_BLOCK_SIZE; | ||
| 1248 | |||
| 1249 | /* get the tail size */ | ||
| 1250 | while (bz > MIN_MEMORY_BLOCK_SIZE) { | ||
| 1251 | if (!((max_pfn << PAGE_SHIFT) & (bz - 1))) | ||
| 1252 | break; | ||
| 1253 | bz >>= 1; | ||
| 1254 | } | ||
| 1255 | |||
| 1256 | printk(KERN_DEBUG "memory block size : %ldMB\n", bz >> 20); | ||
| 1257 | |||
| 1258 | return bz; | ||
| 1259 | } | ||
| 1260 | |||
| 1261 | static unsigned long memory_block_size_probed; | ||
| 1262 | unsigned long memory_block_size_bytes(void) | ||
| 1263 | { | ||
| 1264 | if (!memory_block_size_probed) | ||
| 1265 | memory_block_size_probed = probe_memory_block_size(); | ||
| 1266 | |||
| 1267 | return memory_block_size_probed; | ||
| 1268 | } | ||
| 1269 | |||
| 1244 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 1270 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
| 1245 | /* | 1271 | /* |
| 1246 | * Initialise the sparsemem vmemmap using huge-pages at the PMD level. | 1272 | * Initialise the sparsemem vmemmap using huge-pages at the PMD level. |
