Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp536018ybb; Wed, 8 Apr 2020 05:05:30 -0700 (PDT) X-Google-Smtp-Source: APiQypKEJ5earT2ptH18+GfV3O9aT2QrVLX+vA27THjbPfovI19LFAtxfKcX/POqOFlRetEJffVt X-Received: by 2002:a54:4197:: with SMTP id 23mr2211156oiy.87.1586347530628; Wed, 08 Apr 2020 05:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586347530; cv=none; d=google.com; s=arc-20160816; b=qXdcQs+D3ze3yFBdH5kQBTQd95n3O8Us8wARSlynPP/QT+/gM+j3XpbQo+OwZMitph 8DpkFGeJwmkQkd5bSW+NGj5g1uNSVCn5XFGnKSGjru5mX6kh2nSkw8A8TIXeuzsQRhUj 44Ano7xprXOAyyXzdxz9k3KhgFXVXlvk3HtIzdN7vtA0iF1Hd4IWYGRx14pLRX0r/i36 dPGFxP9yuuVgVHbYbtPgumy5Xg3DCWFCOAbxv46e6hNEtONqKiAgkaBM/1OxluGLESJU TIRoTMM0YufujLzlw4mH7B1u+wyzXN2OVJ+y6Op/TPyZRr5sHdPbV+L3i9RTIZXHn6In le7A== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bBHM+hDSwYwXpplQFIpTmcGbADjtUKFmfQeNb5Nusv4=; b=IacaSwcKqBTS5p0qY4A5KfwTdASrb17SjYBleeqZBB79rgUWBOcAf3kXhKUajKjh2s up8+lY16TSD1bdtYTuc3nAOO4+Uq/fPwttB9j0Q66739qKxGoDxIjtuM9ULv7yq5iSUg ianH3ddVyr8cvI7PDxIHs8bjRV+xaYjqxbDF1nKNw83SQ3ojAqgafxRgYfTc/7JgQuvy 3AoqaoBSO0t6ITOTHHdBp1lZ7O7/S2hJ7weOt5PtU7/vPsU5rWROsAKEB+fnEqqn3Uvv BxVC3T8B/iLfH4DO35lPRC8v5zrgYuuxdyKKai/pqEgJbKBvsNBS6lhebEp7QgV06r2n y0hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="E5EHOU/1"; 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 t19si1893867oif.250.2020.04.08.05.05.05; Wed, 08 Apr 2020 05:05:30 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="E5EHOU/1"; 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 S1728310AbgDHMBI (ORCPT + 99 others); Wed, 8 Apr 2020 08:01:08 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51110 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728213AbgDHMBF (ORCPT ); Wed, 8 Apr 2020 08:01:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=bBHM+hDSwYwXpplQFIpTmcGbADjtUKFmfQeNb5Nusv4=; b=E5EHOU/1jxrKojb9kP9R2f5evY oIqTcxhz8xO+bOobIjQ6F6fNp/1R0fnyH0/uWWrfTEXI1JZEsuWf6lyce4RxGfy6Cp331AKFIvBu1 MWKICj+gyYwlIHoum0YIEypHVw3JRlUnux+N0UTIZBqmaTGkfIutAFKEk4SXlfkSMKYmDHJTL8pjC J7kAwOgmjiJI3ZRt8JlPH3mlOENjkEtBSzYvuI9uEEgBEoX24dBy+rYrhcM7waaJuZx+cuO6T5hBu K3LF/PQtYXVj0Gus4oKVrJLmCTOoEMoSBrF2CaQJjU2HDeCK6EUunuvJB26aQSJmbS98++jqbKlBW sTtynD1w==; Received: from [2001:4bb8:180:5765:65b6:f11e:f109:b151] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jM9Nt-0005Yi-9h; Wed, 08 Apr 2020 12:00:45 +0000 From: Christoph Hellwig To: Andrew Morton , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , x86@kernel.org, David Airlie , Daniel Vetter , Laura Abbott , Sumit Semwal , Sakari Ailus , Minchan Kim , Nitin Gupta Cc: Robin Murphy , Christophe Leroy , Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/28] mm: remove the prot argument to __vmalloc_node Date: Wed, 8 Apr 2020 13:59:19 +0200 Message-Id: <20200408115926.1467567-22-hch@lst.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200408115926.1467567-1-hch@lst.de> References: <20200408115926.1467567-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is always PAGE_KERNEL now. Signed-off-by: Christoph Hellwig --- mm/vmalloc.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 466a449b3a15..de7952959e82 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2401,8 +2401,7 @@ void *vmap(struct page **pages, unsigned int count, EXPORT_SYMBOL(vmap); static void *__vmalloc_node(unsigned long size, unsigned long align, - gfp_t gfp_mask, pgprot_t prot, - int node, const void *caller); + gfp_t gfp_mask, int node, const void *caller); static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot, int node) { @@ -2420,7 +2419,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, /* Please note that the recursion is strictly bounded. */ if (array_size > PAGE_SIZE) { pages = __vmalloc_node(array_size, 1, nested_gfp|highmem_mask, - PAGE_KERNEL, node, area->caller); + node, area->caller); } else { pages = kmalloc_node(array_size, nested_gfp, node); } @@ -2539,13 +2538,11 @@ EXPORT_SYMBOL_GPL(__vmalloc_node_range); * @size: allocation size * @align: desired alignment * @gfp_mask: flags for the page level allocator - * @prot: protection mask for the allocated pages * @node: node to use for allocation or NUMA_NO_NODE * @caller: caller's return address * - * Allocate enough pages to cover @size from the page level - * allocator with @gfp_mask flags. Map them into contiguous - * kernel virtual space, using a pagetable protection of @prot. + * Allocate enough pages to cover @size from the page level allocator with + * @gfp_mask flags. Map them into contiguous kernel virtual space. * * Reclaim modifiers in @gfp_mask - __GFP_NORETRY, __GFP_RETRY_MAYFAIL * and __GFP_NOFAIL are not supported @@ -2556,16 +2553,15 @@ EXPORT_SYMBOL_GPL(__vmalloc_node_range); * Return: pointer to the allocated memory or %NULL on error */ static void *__vmalloc_node(unsigned long size, unsigned long align, - gfp_t gfp_mask, pgprot_t prot, - int node, const void *caller) + gfp_t gfp_mask, int node, const void *caller) { return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END, - gfp_mask, prot, 0, node, caller); + gfp_mask, PAGE_KERNEL, 0, node, caller); } void *__vmalloc(unsigned long size, gfp_t gfp_mask) { - return __vmalloc_node(size, 1, gfp_mask, PAGE_KERNEL, NUMA_NO_NODE, + return __vmalloc_node(size, 1, gfp_mask, NUMA_NO_NODE, __builtin_return_address(0)); } EXPORT_SYMBOL(__vmalloc); @@ -2573,15 +2569,15 @@ EXPORT_SYMBOL(__vmalloc); static inline void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags) { - return __vmalloc_node(size, 1, flags, PAGE_KERNEL, - node, __builtin_return_address(0)); + return __vmalloc_node(size, 1, flags, node, + __builtin_return_address(0)); } void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void *caller) { - return __vmalloc_node(size, 1, flags, PAGE_KERNEL, node, caller); + return __vmalloc_node(size, 1, flags, node, caller); } /** @@ -2656,8 +2652,8 @@ EXPORT_SYMBOL(vmalloc_user); */ void *vmalloc_node(unsigned long size, int node) { - return __vmalloc_node(size, 1, GFP_KERNEL, PAGE_KERNEL, - node, __builtin_return_address(0)); + return __vmalloc_node(size, 1, GFP_KERNEL, node, + __builtin_return_address(0)); } EXPORT_SYMBOL(vmalloc_node); @@ -2670,9 +2666,6 @@ EXPORT_SYMBOL(vmalloc_node); * allocator and map them into contiguous kernel virtual space. * The memory allocated is set to zero. * - * For tight control over page level allocator and protection flags - * use __vmalloc_node() instead. - * * Return: pointer to the allocated memory or %NULL on error */ void *vzalloc_node(unsigned long size, int node) @@ -2745,8 +2738,8 @@ void *vmalloc_exec(unsigned long size) */ void *vmalloc_32(unsigned long size) { - return __vmalloc_node(size, 1, GFP_VMALLOC32, PAGE_KERNEL, - NUMA_NO_NODE, __builtin_return_address(0)); + return __vmalloc_node(size, 1, GFP_VMALLOC32, NUMA_NO_NODE, + __builtin_return_address(0)); } EXPORT_SYMBOL(vmalloc_32); -- 2.25.1