[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <72aaa252-6ee6-4353-84ee-b6e10e9920c6@arm.com>
Date: Thu, 18 Dec 2025 08:34:01 +0000
From: Ryan Roberts <ryan.roberts@....com>
To: Yeoreum Yun <yeoreum.yun@....com>
Cc: catalin.marinas@....com, will@...nel.org, akpm@...ux-foundation.org,
david@...nel.org, kevin.brodsky@....com, quic_zhenhuah@...cinc.com,
dev.jain@....com, yang@...amperecomputing.com, chaitanyas.prakash@....com,
bigeasy@...utronix.de, clrkwllms@...nel.org, rostedt@...dmis.org,
lorenzo.stoakes@...cle.com, ardb@...nel.org, jackmanb@...gle.com,
vbabka@...e.cz, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH v2 2/2] arm64: mmu: avoid allocating pages while
installing ng-mapping for KPTI
On 17/12/2025 19:09, Yeoreum Yun wrote:
> Hi Ryanc,
>
> [...]
>>> - if (!cpu) {
>>> - free_pages(alloc, order);
>>> + if (!cpu)
>>> arm64_use_ng_mappings = true;
>>> - }
>>>
>>> return 0;
>>> }
>>>
>>> void __init kpti_install_ng_mappings(void)
>>> {
>>> + int order = order_base_2(CONFIG_PGTABLE_LEVELS);
>>> + u64 alloc;
>>> +
>>> /* Check whether KPTI is going to be used */
>>> if (!arm64_kernel_unmapped_at_el0())
>>> return;
>>> @@ -1436,8 +1434,14 @@ void __init kpti_install_ng_mappings(void)
>>> if (arm64_use_ng_mappings)
>>> return;
>>>
>>> + alloc = __get_free_pages(GFP_ATOMIC | __GFP_ZERO, order);
>>
>> I don't think this requires GFP_ATOMIC now?
>>
>> With that removed:
>>
>> Reviewed-by: Ryan Roberts <ryan.roberts@....com>
>
> I think it would be better to use only __GFP_HIGH in here since
> when kpti_install_ng_mappings() is called, "kswpd" doesn't created yet.
> and to allocate page with assurance, It would be good to use
> min_reserved to.
>
> Am I missing something?
Personally I think we should just use "GFP_KERNEL | __GFP_ZERO". Anything else
would make this allocation look special, which it is not. If we fail to allocate
at this point in boot, we have bigger problems.
>
> Thanks.
>
> [...]
>
> --
> Sincerely,
> Yeoreum Yun
Powered by blists - more mailing lists