Message ID | 20180621083158.30849-2-aneesh.kumar@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 7d4340bb92a9df78e6e28152f3dd89d9bd82146b |
Headers | show |
Series | [1/2] powerpc/mm: Check memblock_add against MAX_PHYSMEM_BITS range | expand |
On Thu, Jun 21, 2018 at 6:31 PM, Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> wrote: > > We do this only with VMEMMAP config so that our page_to_[nid/section] etc are not > impacted. > > Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Why 128TB, given that it's sparse_vmemmap_extreme by default, why not 1PB directly (50 bits)? Balbir Singh
On 06/21/2018 05:02 PM, Balbir Singh wrote: > On Thu, Jun 21, 2018 at 6:31 PM, Aneesh Kumar K.V > <aneesh.kumar@linux.ibm.com> wrote: >> >> We do this only with VMEMMAP config so that our page_to_[nid/section] etc are not >> impacted. >> >> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> > > Why 128TB, given that it's sparse_vmemmap_extreme by default, why not > 1PB directly (50 bits)? > That will impact config with VMEMMAP_EXTREME with no real immediate benefit. We could possibly make MAX_PHYSMEM_BITS a Kconfig variable. s390 do that. Not sure we want to do that. -aneesh
On 06/21/2018 05:02 PM, Balbir Singh wrote: > On Thu, Jun 21, 2018 at 6:31 PM, Aneesh Kumar K.V > <aneesh.kumar@linux.ibm.com> wrote: >> >> We do this only with VMEMMAP config so that our page_to_[nid/section] etc are not >> impacted. >> >> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> > > Why 128TB, given that it's sparse_vmemmap_extreme by default, why not > 1PB directly (50 bits)? > That will impact config with VMEMMAP_EXTREME disabled with no real immediate benefit. We could possibly make MAX_PHYSMEM_BITS a Kconfig variable. s390 do that. Not sure we want to do that. -aneesh
diff --git a/arch/powerpc/include/asm/sparsemem.h b/arch/powerpc/include/asm/sparsemem.h index bc66712bdc3c..28f5dae25db6 100644 --- a/arch/powerpc/include/asm/sparsemem.h +++ b/arch/powerpc/include/asm/sparsemem.h @@ -6,13 +6,20 @@ #ifdef CONFIG_SPARSEMEM /* * SECTION_SIZE_BITS 2^N: how big each section will be - * MAX_PHYSADDR_BITS 2^N: how much physical address space we have * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space */ #define SECTION_SIZE_BITS 24 - -#define MAX_PHYSADDR_BITS 46 +/* + * If we store section details in page->flags we can't increase the MAX_PHYSMEM_BITS + * if we increase SECTIONS_WIDTH we will not store node details in page->flags and + * page_to_nid does a page->section->node lookup + * Hence only increase for VMEMMAP. + */ +#ifdef CONFIG_SPARSEMEM_VMEMMAP +#define MAX_PHYSMEM_BITS 47 +#else #define MAX_PHYSMEM_BITS 46 +#endif #endif /* CONFIG_SPARSEMEM */
We do this only with VMEMMAP config so that our page_to_[nid/section] etc are not impacted. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> --- arch/powerpc/include/asm/sparsemem.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)