[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <86v81gk0b9.fsf@scott-ph-mail.amperecomputing.com>
Date: Sun, 07 Jul 2024 20:52:10 -0700
From: D Scott Phillips <scott@...amperecomputing.com>
To: Catalin Marinas <catalin.marinas@....com>, Anshuman Khandual
<anshuman.khandual@....com>
Cc: linux-arm-kernel@...ts.infradead.org, Will Deacon <will@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>, "Kirill A. Shutemov"
<kirill.shutemov@...ux.intel.com>, linux-kernel@...r.kernel.org,
patches@...erecomputing.com
Subject: Re: [PATCH] arm64: limit MAX_PHYSMEM_BITS based on vmemmap
Catalin Marinas <catalin.marinas@....com> writes:
> On Thu, Jul 04, 2024 at 08:42:52AM +0530, Anshuman Khandual wrote:
> > On 7/4/24 02:37, D Scott Phillips wrote:
> > > diff --git a/arch/arm64/include/asm/sparsemem.h b/arch/arm64/include/asm/sparsemem.h
> > > index 8a8acc220371c..8387301f2e206 100644
> > > --- a/arch/arm64/include/asm/sparsemem.h
> > > +++ b/arch/arm64/include/asm/sparsemem.h
> > > @@ -5,7 +5,7 @@
> > > #ifndef __ASM_SPARSEMEM_H
> > > #define __ASM_SPARSEMEM_H
> > >
> > > -#define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS
> > > +#define MAX_PHYSMEM_BITS ilog2(VMEMMAP_RANGE)
> >
> > Just wondering if there is another method, which avoids selecting
> > physical memory ranges not backed with vmemmap. Also will reducing
> > MAX_PHYSMEM_BITS below ARM64_PA_BITS have other side effects ? Do
> > other platforms have this exact same co-relation between
> > MAX_PHYSMEM_BITS and vmemmap range ?
>
> That's indeed a pretty weird workaround. MAX_PHYSMEM_BITS, as the name
> implies, is about the physical bits supported for memory while
> VMEMMAP_RANGE tells us the virtual address range. There is a
> correlation between them but they are different things conceptually.
>
> The memory hotplug code uses arch_get_mappable_range(). This should be
> called from the amdgpu code rather than changing MAX_PHYSMEM_BITS.
OK, thanks I'll pursue that approach.
Powered by blists - more mailing lists