[Crash-utility] ARM support for CONFIG_SPARSEMEM: (was Re: DDimage)
Dave Anderson
anderson at redhat.com
Wed May 25 18:37:17 UTC 2011
----- Original Message -----
> ----- Original Message -----
> > Hi Dave,
> >
> > Now I am quite sure the definition of NR_SECTION_ROOTS() is wrong.
> > In the upstream kernel, I found the following
> > include/linux/mmzone.h
> > ...
> > 994 #define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT)
> > 995 #define NR_SECTION_ROOTS DIV_ROUND_UP(NR_MEM_SECTIONS, SECTIONS_PER_ROOT)
> > 996 #define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
> >
> > and include/kernel.h DIV_ROUND_UP is defined as follows,
> > 58 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
> >
> > I hope you can take care of this.
> >
> > By the way, I think _SECTION_SIZE_BITS issue is a separate issue.
> >
> > Best Regard,
> >
> > Takuo
>
> Hello Takuo,
... [ cut ] ...
> I'll test this out, and presuming that nothing breaks w/respect to
> backwards compatibility, I'll change the crash version of
> NR_SECTION_ROOTS.
>
> But, as you state, the _SECTION_SIZE_BITS is based upon whatever your
> kernel is doing.
>
> Thanks,
> Dave
Hello Takuo,
I have tested and queued this patch for the next release:
diff -u -r1.466 defs.h
--- defs.h 11 May 2011 13:24:36 -0000 1.466
+++ defs.h 25 May 2011 18:31:39 -0000
@@ -2184,7 +2184,8 @@
#define _SECTIONS_PER_ROOT() (1)
#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT())
-#define NR_SECTION_ROOTS() (NR_MEM_SECTIONS() / SECTIONS_PER_ROOT())
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define NR_SECTION_ROOTS() (DIV_ROUND_UP(NR_MEM_SECTIONS(), SECTIONS_PER_ROOT()))
#define SECTION_ROOT_MASK() (SECTIONS_PER_ROOT() - 1)
/*
Thanks for catching this,
Dave
More information about the Crash-utility
mailing list