提交 7fc2368d 编写于 作者: Y Yinghai Lu 提交者: Ingo Molnar

x86: don't need to go to chunksize to 4G

change back chunksize max to 2g
   otherwise will get strange layout in 2G ram system like
     0 - 4g WB, 2040M - 2048M UC, 2048M -  4G NC
   instead of
     0 - 2g WB, 2040M - 2048M UC
Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 6ef190cc
...@@ -1155,10 +1155,10 @@ struct mtrr_cleanup_result { ...@@ -1155,10 +1155,10 @@ struct mtrr_cleanup_result {
/* /*
* gran_size: 1M, 2M, ..., 2G * gran_size: 1M, 2M, ..., 2G
* chunk size: gran_size, ..., 4G * chunk size: gran_size, ..., 2G
* so we need (2+13)*6 * so we need (1+12)*6
*/ */
#define NUM_RESULT 90 #define NUM_RESULT 78
#define PSHIFT (PAGE_SHIFT - 10) #define PSHIFT (PAGE_SHIFT - 10)
static struct mtrr_cleanup_result __initdata result[NUM_RESULT]; static struct mtrr_cleanup_result __initdata result[NUM_RESULT];
...@@ -1276,7 +1276,7 @@ static int __init mtrr_cleanup(unsigned address_bits) ...@@ -1276,7 +1276,7 @@ static int __init mtrr_cleanup(unsigned address_bits)
memset(min_loss_pfn, 0xff, sizeof(min_loss_pfn)); memset(min_loss_pfn, 0xff, sizeof(min_loss_pfn));
memset(result, 0, sizeof(result)); memset(result, 0, sizeof(result));
for (gran_size = (1ULL<<20); gran_size < (1ULL<<32); gran_size <<= 1) { for (gran_size = (1ULL<<20); gran_size < (1ULL<<32); gran_size <<= 1) {
for (chunk_size = gran_size; chunk_size < (1ULL<<33); for (chunk_size = gran_size; chunk_size < (1ULL<<32);
chunk_size <<= 1) { chunk_size <<= 1) {
int num_reg; int num_reg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册