[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9dd9a8ef-8db8-891c-79a9-270ab033037c@arm.com>
Date: Sat, 12 Jan 2019 18:25:48 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org, linux-sh@...r.kernel.org,
kvmarm@...ts.cs.columbia.edu, linux@...linux.org.uk,
catalin.marinas@....com, will.deacon@....com, mpe@...erman.id.au,
tglx@...utronix.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
peterz@...radead.org, christoffer.dall@....com,
marc.zyngier@....com, kirill@...temov.name,
rppt@...ux.vnet.ibm.com, mhocko@...e.com,
ard.biesheuvel@...aro.org, mark.rutland@....com,
steve.capper@....com, james.morse@....com, robin.murphy@....com,
aneesh.kumar@...ux.ibm.com, vbabka@...e.cz, shakeelb@...gle.com,
rientjes@...gle.com
Subject: Re: [PATCH] mm: Introduce GFP_PGTABLE
On 01/12/2019 05:42 PM, Matthew Wilcox wrote:
> On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote:
>> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL |
>> __GFP_ZERO) and using it for allocating page table pages.
>
> Except that's not true.
>
>> +++ b/arch/x86/mm/pgtable.c
>> @@ -13,19 +13,17 @@ phys_addr_t physical_mask __ro_after_init = (1ULL << __PHYSICAL_MASK_SHIFT) - 1;
>> EXPORT_SYMBOL(physical_mask);
>> #endif
>>
>> -#define PGALLOC_GFP (GFP_KERNEL_ACCOUNT | __GFP_ZERO)
>> -
>> #ifdef CONFIG_HIGHPTE
>
> ...
>
>> pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
>> {
>> - return (pte_t *)__get_free_page(PGALLOC_GFP & ~__GFP_ACCOUNT);
>> + return (pte_t *)__get_free_page(GFP_PGTABLE & ~__GFP_ACCOUNT);
>> }
>
> I think x86 was the only odd one out here, but you'll need to try again ...
IIUC the user page table pages need __GFP_ACCOUNT not the kernel ones. Hence
in the above function it clears out __GFP_ACCOUNT for kernel page table page
allocations but where as by default it has got __GFP_ACCOUNT which would be
used for user page tables. Instead we can make X86 user allocations add
__GFP_ACCOUNT (like other archs) to generic GFP_PGTABLE when ever required.
Powered by blists - more mailing lists