makedumpfile: fix bug on is_sparsemem_extreme
Subsystems (2)
PATCH 1/1 makedumpfile: fix bug on is_sparsemem_extreme
The kernel gets the length of mem_section use this
from: include/linux/mmzone.h:1134
"#define NR_SECTION_ROOTS DIV_ROUND_UP(NR_MEM_SECTIONS,
SECTIONS_PER_ROOT)"
But when we check the memory model. We forget the
"DIV_ROUND_UP" method.
So when 32-bit ARM linux is in sparsemem_extreme memory:
with SECTION_SIZE_BIT=28 and 16 byte-size mem_section.
The makedumpfile can not identify the memory correctly.
This patch introduce the "DIV_ROUND_UP" method in this check.
--- makedumpfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
makedumpfile.c +1 -1
@@ -1599,7 +1599,7 @@ intis_sparsemem_extreme (void) {if (ARRAY_LENGTH (mem_section) - == (NR_MEM_SECTIONS () /_SECTIONS_PER_ROOT_EXTREME ())) + ==divideup (NR_MEM_SECTIONS (),_SECTIONS_PER_ROOT_EXTREME ()))return TRUE;else return FALSE;
Signature · 7 lines
1.9.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 6 lines
The kernel gets the length of
mem_sectionuse this
from:include/linux/mmzone.h:1134"#define
NR_SECTION_ROOTSDIV_ROUND_UP(NR_MEM_SECTIONS,
SECTIONS_PER_ROOT)"
Quoted 8 lines
But when we check the memory model. We forget the
"DIV_ROUND_UP" method.So when 32-bit ARM linux is in
sparsemem_extremememory:
with SECTION_SIZE_BIT=28 and 16 byte-sizemem_section. The makedumpfile can not identify the memory correctly.This patch introduce the "
DIV_ROUND_UP" method in this check.
Thanks, I'll merge this patch into v1.5.7.
Atsushi Kumagai
Quoted 19 lines
Signed-off-by Liu Hua <[email protected]>---
makedumpfile.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)makedumpfile.c +1
-2@@ -1599,7 +1599,7 @@ intis_sparsemem_extreme (void) {if (ARRAY_LENGTH (mem_section) - == (NR_MEM_SECTIONS () /_SECTIONS_PER_ROOT_EXTREME ())) + ==divideup (NR_MEM_SECTIONS (),_SECTIONS_PER_ROOT_EXTREME ()))return TRUE;else return FALSE; --
Quoted 1 line
1.9.0
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec