Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3157567imu; Sun, 13 Jan 2019 20:15:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN7lpruNNlKsVmvtn5T8IjB/7wvcXcXxHqMQzxI+LJ8FTnnDnFGGyA5uW0th0GxXvOKx+8ty X-Received: by 2002:a62:4156:: with SMTP id o83mr23733906pfa.72.1547439335244; Sun, 13 Jan 2019 20:15:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547439335; cv=none; d=google.com; s=arc-20160816; b=GDjNllvSX4kdQ4zV+WE7PNVhOriaG9fuQQWqs5O1U0O1U4rmuhqWHkRK4PQuXLmBOV Oo0Q0xUF+IIFRPTFAc1Am4yK6fOFCTmFymTttiEBYsw0RBCBec5BCaQemupXTLT79K0w faIY+gtRNZUFFt837ObJaU5g12pl5QvDPhDtQXsNyEm7k6uJN4w8kudrAQqtndh7p5X5 f3rrPydOdbXDNarS8yrtpxu7HJX5oUyTzOR7vcq2gcFWqJIHpYTBXprTInkf7TGmw5H7 ip+sH74berGXVSIoS7mH97dYFaQWFvnnY677OQx4yqxSDUNxew9DrUKgAlxWMNyc7qeL q40A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=7rk5bmzNWhtYTrJ+WlSM5OXPxOcegUeAFw0homRVpSM=; b=iaIiBZF5dHyhvRWRblOwGJxpHw/p0At9BIVUJiRRkznlNA7kaCUJVNxYKKIa8OXpmt j/iaZjMvF3B9ZsOfqBq9FFOgjnuuGUO8Aq3HgY3tZPmTT4GLblYk4VxlrpB/54xKgCr4 cGDfMJD9MCn/YnFFX29ojD4s2YrDiUOVrge2vePwIzRjHqlm2l/CRI9oSbi3eN4B52K5 Pxom1j4EEgHs7zWrocMkghH/5r48ZkJn6VMg1TxvmyHk6HDtC5/fCAIVNMidJ6qUXnc1 dnKTBWpJ7IlOfB99wCZY8USRWBTYe0yvhTibizuHNMo5CuXbSiUMB4VWRXY0dn9RFXIm LmTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l96si2869270plb.292.2019.01.13.20.15.19; Sun, 13 Jan 2019 20:15:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726526AbfANEOP (ORCPT + 99 others); Sun, 13 Jan 2019 23:14:15 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54418 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbfANEOP (ORCPT ); Sun, 13 Jan 2019 23:14:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4127080D; Sun, 13 Jan 2019 20:14:14 -0800 (PST) Received: from [10.162.42.129] (p8cg001049571a15.blr.arm.com [10.162.42.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F36C23F5BD; Sun, 13 Jan 2019 20:14:04 -0800 (PST) Subject: Re: [PATCH] mm: Introduce GFP_PGTABLE To: Shakeel Butt Cc: Linux MM , Andrew Morton , LKML , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, mpe@ellerman.id.au, Thomas Gleixner , Ingo Molnar , Dave Hansen , peterz@infradead.org, christoffer.dall@arm.com, marc.zyngier@arm.com, "Kirill A. Shutemov" , Mike Rapoport , Michal Hocko , ard.biesheuvel@linaro.org, mark.rutland@arm.com, steve.capper@arm.com, james.morse@arm.com, robin.murphy@arm.com, aneesh.kumar@linux.ibm.com, Vlastimil Babka , David Rientjes References: <1547288798-10243-1-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: <5e87d900-9548-1782-6244-6dcf7339139d@arm.com> Date: Mon, 14 Jan 2019 09:44:05 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/12/2019 10:18 PM, Shakeel Butt wrote: >> --- a/arch/x86/kernel/espfix_64.c >> +++ b/arch/x86/kernel/espfix_64.c >> @@ -57,8 +57,6 @@ >> # error "Need more virtual address space for the ESPFIX hack" >> #endif >> >> -#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO) >> - >> /* This contains the *bottom* address of the espfix stack */ >> DEFINE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack); >> DEFINE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr); >> @@ -172,7 +170,7 @@ void init_espfix_ap(int cpu) >> pud_p = &espfix_pud_page[pud_index(addr)]; >> pud = *pud_p; >> if (!pud_present(pud)) { >> - struct page *page = alloc_pages_node(node, PGALLOC_GFP, 0); >> + struct page *page = alloc_pages_node(node, GFP_PGTABLE, 0); >> >> pmd_p = (pmd_t *)page_address(page); >> pud = __pud(__pa(pmd_p) | (PGTABLE_PROT & ptemask)); >> @@ -184,7 +182,7 @@ void init_espfix_ap(int cpu) >> pmd_p = pmd_offset(&pud, addr); >> pmd = *pmd_p; >> if (!pmd_present(pmd)) { >> - struct page *page = alloc_pages_node(node, PGALLOC_GFP, 0); >> + struct page *page = alloc_pages_node(node, GFP_PGTABLE, 0); >> >> pte_p = (pte_t *)page_address(page); >> pmd = __pmd(__pa(pte_p) | (PGTABLE_PROT & ptemask)); >> diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c >> index 7bd0170..d608b03 100644 >> --- a/arch/x86/mm/pgtable.c >> +++ 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) >> - > You have silently dropped __GFP_ACCOUNT from all the allocations in this file. Right, they need to be added back explicitly after GFP_PGTABLE. Matthew had pointed this earlier. Will fix it next time around. > > BTW why other archs not using __GFP_ACCOUNT for the user page tables? > Some archs do and some dont. User page tables pages should use __GFP_ACCOUNT for allocation. I am working on fixing it for arm64.