All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: fix bug on is_sparsemem_extreme
@ 2014-05-07  1:43 Liu Hua
  2014-05-07  7:38 ` Atsushi Kumagai
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Hua @ 2014-05-07  1:43 UTC (permalink / raw)
  To: kumagai-atsushi, chaowang; +Cc: wangnan0, kexec, peifeiyue, Liu Hua

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.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
---
 makedumpfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 0b31932..16081a5 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -1599,7 +1599,7 @@ int
 is_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;
-- 
1.9.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] makedumpfile: fix bug on is_sparsemem_extreme
  2014-05-07  1:43 [PATCH] makedumpfile: fix bug on is_sparsemem_extreme Liu Hua
@ 2014-05-07  7:38 ` Atsushi Kumagai
  0 siblings, 0 replies; 2+ messages in thread
From: Atsushi Kumagai @ 2014-05-07  7:38 UTC (permalink / raw)
  To: sdu.liu, chaowang; +Cc: wangnan0, kexec, peifeiyue

>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.

Thanks, I'll merge this patch into v1.5.7.

Atsushi Kumagai

>Signed-off-by: Liu Hua <sdu.liu@huawei.com>
>---
> makedumpfile.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/makedumpfile.c b/makedumpfile.c
>index 0b31932..16081a5 100644
>--- a/makedumpfile.c
>+++ b/makedumpfile.c
>@@ -1599,7 +1599,7 @@ int
> is_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;
>--
>1.9.0

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-07  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07  1:43 [PATCH] makedumpfile: fix bug on is_sparsemem_extreme Liu Hua
2014-05-07  7:38 ` Atsushi Kumagai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.