Re: [PATCH v2 7/9] mm: Calc the right pfn if page size is not 4K
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH v2 7/9] mm: Calc the right pfn if page size is not 4K
- From: Ard Biesheuvel <ardb@xxxxxxxxxx>
- Date: Thu, 21 Apr 2022 00:39:32 +0200
- Cc: Anshuman Khandual <anshuman.khandual@xxxxxxx>, Wupeng Ma <mawupeng1@xxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, X86 ML <x86@xxxxxxxxxx>, hpa@xxxxxxxxx, Darren Hart <dvhart@xxxxxxxxxxxxx>, Andy Shevchenko <andy@xxxxxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, "Paul E. McKenney" <paulmck@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Joerg Roedel <jroedel@xxxxxxx>, songmuchun@xxxxxxxxxxxxx, macro@xxxxxxxxxxx, Frederic Weisbecker <frederic@xxxxxxxxxx>, W_Armin@xxxxxx, John Garry <john.garry@xxxxxxxxxx>, Sean Christopherson <seanjc@xxxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, chenhuacai@xxxxxxxxxx, David Hildenbrand <david@xxxxxxxxxx>, gpiccoli@xxxxxxxxxx, Mark Rutland <mark.rutland@xxxxxxx>, Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>, Linux Doc Mailing List <linux-doc@xxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-efi <linux-efi@xxxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, platform-driver-x86@xxxxxxxxxxxxxxx, Linux Memory Management List <linux-mm@xxxxxxxxx>
- In-reply-to: <20220420152749.d41097e7d53ccd6a2a2aea5f@linux-foundation.org>
- References: <20220414101314.1250667-1-mawupeng1@huawei.com> <20220414101314.1250667-8-mawupeng1@huawei.com> <672ff459-81bd-38ef-882d-e718992d295c@arm.com> <CAMj1kXFnEhJ4Qu50Ads9psY6kmT3ddw5Za+6-YqUM+eYj1Oafw@mail.gmail.com> <20220420152749.d41097e7d53ccd6a2a2aea5f@linux-foundation.org>
On Thu, 21 Apr 2022 at 00:27, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, 19 Apr 2022 20:29:27 +0200 Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
>
> > > > --- a/mm/page_alloc.c
> > > > +++ b/mm/page_alloc.c
> > > > @@ -7870,7 +7870,7 @@ static void __init find_zone_movable_pfns_for_nodes(void)
> > > >
> > > > usable_startpfn = memblock_region_memory_base_pfn(r);
> > > >
> > > > - if (usable_startpfn < 0x100000) {
> > > > + if (usable_startpfn < PHYS_PFN(SZ_4G)) {
> > > > mem_below_4gb_not_mirrored = true;
> > > > continue;
> > > > }
> > >
> > > Regardless PFN value should never be encoded directly.
> > >
> > > Reviewed-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
> >
> > Acked-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
> >
> > Andrew, can you please take this one through the -mm tree? The rest of
> > the series needs a bit more work, but is an obvious fix and there is
> > no point in holding it up.
>
> Sure.
>
> I'm not seeing any description of the runtime effects of this
> shortcoming. I tentatively queued the fix for 5.18, without a
> cc:stable for backporting. But that might not be the best decision?
>
As far as I can tell, mirrored memory is only used on x86 today, where
pages are always 4k.
However, the whole notion of memory below 4 GB being special is a
x86-ism, and so this logic does not appear to extrapolate to other
architectures anyway, and probably needs more work.
So definitely not a backportable fix, but just an incremental
improvement, so either 5.18 or 5.19 should be fine afaict (and no
cc:stable)
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]