From: Catalin Marinas <catalin.marinas@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: D Scott Phillips <scott@os.amperecomputing.com>,
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: Thu, 4 Jul 2024 15:08:53 +0100 [thread overview]
Message-ID: <Zoas9V3sLEOzULhs@arm.com> (raw)
In-Reply-To: <7d7134fe-f97d-453d-b90d-fb81008fff40@arm.com>
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.
--
Catalin
next prev parent reply other threads:[~2024-07-04 14:08 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 [this message]
2024-07-08 3:52 ` D Scott Phillips
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=Zoas9V3sLEOzULhs@arm.com \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@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=scott@os.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