diff options
author | Yinghai Lu <yhlu.kernel.send@gmail.com> | 2008-04-29 04:59:49 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-25 04:55:09 -0400 |
commit | 42651f15824d003e8357693ab72c4dbb3e280836 (patch) | |
tree | 1114071a407bfeb38edc12b7c822039641cd5c13 /arch/x86/kernel/e820_32.c | |
parent | 95ffa2438d0e9c48779f0106b1c0eb36165e759c (diff) |
x86: fix trimming e820 with MTRR holes.
converting MTRR layout from continous to discrete, some time could run out of
MTRRs. So add gran_sizek to prevent that by dumpping small RAM piece less than
gran_sizek.
previous trimming only can handle highest_pfn from mtrr to end_pfn from e820.
when have more than 4g RAM installed, there will be holes below 4g. so need to
check ram below 4g is coverred well.
need to be applied after
[PATCH] x86: mtrr cleanup for converting continuous to discrete layout v7
Signed-off-by: Yinghai Lu <yinghai.lu@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/e820_32.c')
-rw-r--r-- | arch/x86/kernel/e820_32.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c index 31ea2bb8c91a..857f706273a8 100644 --- a/arch/x86/kernel/e820_32.c +++ b/arch/x86/kernel/e820_32.c | |||
@@ -783,10 +783,11 @@ static int __init parse_memmap(char *arg) | |||
783 | return 0; | 783 | return 0; |
784 | } | 784 | } |
785 | early_param("memmap", parse_memmap); | 785 | early_param("memmap", parse_memmap); |
786 | void __init update_memory_range(u64 start, u64 size, unsigned old_type, | 786 | u64 __init update_memory_range(u64 start, u64 size, unsigned old_type, |
787 | unsigned new_type) | 787 | unsigned new_type) |
788 | { | 788 | { |
789 | int i; | 789 | int i; |
790 | u64 real_updated_size = 0; | ||
790 | 791 | ||
791 | BUG_ON(old_type == new_type); | 792 | BUG_ON(old_type == new_type); |
792 | 793 | ||
@@ -798,6 +799,7 @@ void __init update_memory_range(u64 start, u64 size, unsigned old_type, | |||
798 | /* totally covered? */ | 799 | /* totally covered? */ |
799 | if (ei->addr >= start && ei->size <= size) { | 800 | if (ei->addr >= start && ei->size <= size) { |
800 | ei->type = new_type; | 801 | ei->type = new_type; |
802 | real_updated_size += ei->size; | ||
801 | continue; | 803 | continue; |
802 | } | 804 | } |
803 | /* partially covered */ | 805 | /* partially covered */ |
@@ -807,7 +809,10 @@ void __init update_memory_range(u64 start, u64 size, unsigned old_type, | |||
807 | continue; | 809 | continue; |
808 | add_memory_region(final_start, final_end - final_start, | 810 | add_memory_region(final_start, final_end - final_start, |
809 | new_type); | 811 | new_type); |
812 | real_updated_size += final_end - final_start; | ||
810 | } | 813 | } |
814 | |||
815 | return real_updated_size; | ||
811 | } | 816 | } |
812 | 817 | ||
813 | void __init finish_e820_parsing(void) | 818 | void __init finish_e820_parsing(void) |