Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3404322imm; Tue, 17 Jul 2018 04:24:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMKV80yyu8VoyxZwRrFmsMbseg+2iBAyOzQvZXs8D77l0v+YMbUx4Z4JhwmUh21ym8mMO0 X-Received: by 2002:a63:a1a:: with SMTP id 26-v6mr1193446pgk.221.1531826681126; Tue, 17 Jul 2018 04:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826681; cv=none; d=google.com; s=arc-20160816; b=T+7VXodosR0rHM81X0LX0sBw/Dhle5ZGQDx6UWVUqgSUHYMbCYmdDWMZ1/C0QYjqGh +sJu5dBAapJJugc8qPBnnRbYXyxX9T9lXchwJcNchGEKaZfzB/vNI3WUNXIA0YMJ1+wh PV2VhS5pcmCbpjbr9z70exA9ZD2zbeI1dHznLTGt4DypWaH7vyaGX5MP8n6PjCfms1gZ 2oS4MSk/hLUZPUwaxpfA5LVQPHWMY0dxJ7Vm37Tn9513iw1/DiXpF+/ZheUrhEk9+z5k 3oC0+L0dFVujRsaL8FWAwQa++/iaDHXhhmYVeDbDmEGLYI1PUGShNRoeObtFQ++XeEnp vp8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=tL5Meckb5kr8LRcF0rqHZgkyn3KGinqxWE4pFYGX7wQ=; b=ys9oX0nYxOqxvaac4l2Yg19PNnoL+XiAom2u/a08reDtsijCPolpJAMCmqWVvJf+HX xLLITsM7NP5NNYB7mN3z5pqrDB0lGEtfWdRKW94D5GfLbUxqVnMV0xMPMCl2ybXYDvPo AKKrp6j63s/1RlMJIYlU2zATykWNAW+eYZinLS2cZMwdlITRJe3h58CM3M3D2CWyy5fb AmL+v+/uxh1fI1571T0ObQy53WUcxNKpU35oZDIJlrRLIoEW908I86YV99Ax1jdFZKW5 GIAsSuhGpsBLBPKeK453axXYqh/4aNLS5pVZbJ1dP/G3NXTAkjyHcCB8iXICbOuAtLsS 7tDQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si676657plk.49.2018.07.17.04.24.26; Tue, 17 Jul 2018 04:24:41 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731289AbeGQLxy (ORCPT + 99 others); Tue, 17 Jul 2018 07:53:54 -0400 Received: from mga17.intel.com ([192.55.52.151]:62278 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730839AbeGQLxx (ORCPT ); Tue, 17 Jul 2018 07:53:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 04:21:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,365,1526367600"; d="scan'208";a="57508411" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 17 Jul 2018 04:21:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id D78EC32F; Tue, 17 Jul 2018 14:21:48 +0300 (EEST) From: "Kirill A. Shutemov" To: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky Cc: Dave Hansen , Kai Huang , Jacob Pan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv5 04/19] mm/page_alloc: Unify alloc_hugepage_vma() Date: Tue, 17 Jul 2018 14:20:14 +0300 Message-Id: <20180717112029.42378-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180717112029.42378-1-kirill.shutemov@linux.intel.com> References: <20180717112029.42378-1-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We don't need to have separate implementations of alloc_hugepage_vma() for NUMA and non-NUMA. Using variant based on alloc_pages_vma() we would cover both cases. This is preparation patch for allocation encrypted pages. alloc_pages_vma() will handle allocation of encrypted pages. With this change we don' t need to cover alloc_hugepage_vma() separately. The change makes typo in Alpha's implementation of __alloc_zeroed_user_highpage() visible. Fix it too. Signed-off-by: Kirill A. Shutemov --- arch/alpha/include/asm/page.h | 2 +- include/linux/gfp.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/alpha/include/asm/page.h b/arch/alpha/include/asm/page.h index f3fb2848470a..9a6fbb5269f3 100644 --- a/arch/alpha/include/asm/page.h +++ b/arch/alpha/include/asm/page.h @@ -18,7 +18,7 @@ extern void clear_page(void *page); #define clear_user_page(page, vaddr, pg) clear_page(page) #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ - alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr) + alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE extern void copy_page(void * _to, void * _from); diff --git a/include/linux/gfp.h b/include/linux/gfp.h index a6afcec53795..66f395737990 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -494,21 +494,19 @@ alloc_pages(gfp_t gfp_mask, unsigned int order) extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, struct vm_area_struct *vma, unsigned long addr, int node, bool hugepage); -#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ - alloc_pages_vma(gfp_mask, order, vma, addr, numa_node_id(), true) #else #define alloc_pages(gfp_mask, order) \ alloc_pages_node(numa_node_id(), gfp_mask, order) #define alloc_pages_vma(gfp_mask, order, vma, addr, node, false)\ alloc_pages(gfp_mask, order) -#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ - alloc_pages(gfp_mask, order) #endif #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) #define alloc_page_vma(gfp_mask, vma, addr) \ alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id(), false) #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ alloc_pages_vma(gfp_mask, 0, vma, addr, node, false) +#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ + alloc_pages_vma(gfp_mask, order, vma, addr, numa_node_id(), true) extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); extern unsigned long get_zeroed_page(gfp_t gfp_mask); -- 2.18.0