From: D Scott Phillips <scott@os.amperecomputing.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
Will Deacon <will@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
linux-kernel@vger.kernel.org, patches@amperecomputing.com
Subject: Re: [PATCH] arm64: limit MAX_PHYSMEM_BITS based on vmemmap
Date: Sun, 07 Jul 2024 20:52:10 -0700 [thread overview]
Message-ID: <86v81gk0b9.fsf@scott-ph-mail.amperecomputing.com> (raw)
In-Reply-To: <Zoas9V3sLEOzULhs@arm.com>
Catalin Marinas <catalin.marinas@arm.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.
next prev parent reply other threads:[~2024-07-09 0:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 21:07 [PATCH] arm64: limit MAX_PHYSMEM_BITS based on vmemmap D Scott Phillips
2024-07-04 3:12 ` Anshuman Khandual
2024-07-04 14:08 ` Catalin Marinas
2024-07-08 3:52 ` D Scott Phillips [this message]
2024-07-08 3:52 ` D Scott Phillips
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86v81gk0b9.fsf@scott-ph-mail.amperecomputing.com \
--to=scott@os.amperecomputing.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@amperecomputing.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).