[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a7c3a71-0be7-261e-20b7-54b4864eedb5@google.com>
Date: Wed, 23 Mar 2022 16:48:57 -0700
From: Junaid Shahid <junaids@...gle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
pbonzini@...hat.com, jmattson@...gle.com, pjt@...gle.com,
oweisse@...gle.com, alexandre.chartre@...cle.com,
rppt@...ux.ibm.com, dave.hansen@...ux.intel.com,
peterz@...radead.org, tglx@...utronix.de, luto@...nel.org,
linux-mm@...ck.org
Subject: Re: [RFC PATCH 10/47] mm: asi: Support for global non-sensitive
direct map allocations
Hi Matthew,
On 3/23/22 14:06, Matthew Wilcox wrote:
> On Tue, Feb 22, 2022 at 09:21:46PM -0800, Junaid Shahid wrote:
>> standard ASI instances. A new page flag is also added so that when
>> these pages are freed, they can also be unmapped from the ASI page
>> tables.
>
> It's cute how you just throw this in as an aside. Page flags are
> in high demand and just adding them is not to be done lightly. Is
> there any other way of accomplishing what you want?
>
I suppose we may be able to use page_ext instead. That certainly should be
feasible for the PG_local_nonsensitive flag introduced in a later patch,
although I am not completely sure about the PG_global_nonsensitive flag. That
could get slightly tricky (though likely still possible to do) in case we need
to allocate any non-sensitive memory before page_ext is initialized. One concern
with using page_ext could be the extra memory usage on large machines.
BTW is page flag scarcity an issue on 64-bit systems as well, or only 32-bit
systems? ASI is only supported on 64-bit systems (at least currently).
>> @@ -542,6 +545,12 @@ TESTCLEARFLAG(Young, young, PF_ANY)
>> PAGEFLAG(Idle, idle, PF_ANY)
>> #endif
>>
>> +#ifdef CONFIG_ADDRESS_SPACE_ISOLATION
>> +__PAGEFLAG(GlobalNonSensitive, global_nonsensitive, PF_ANY);
>
> Why is PF_ANY appropriate?
>
I think we actually can use PF_HEAD here. That would make the alloc_pages path
faster too. I'll change to that. (Initially I had gone with PF_ANY because in
theory, you could allocate a compound page and then break it later and free the
individual pages, but I don't know if that actually happens apart from THP, and
certainly doesn't look like the case for any of the stuff that we have marked as
non-sensitive.)
Thanks,
Junaid
Powered by blists - more mailing lists