Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp534905ybb; Wed, 8 Apr 2020 05:04:32 -0700 (PDT) X-Google-Smtp-Source: APiQypKpTJV9LqH5QjUZtoGfXtH+2GFLzNRQk+Ydfk4QOoR8ghfW3NLYS1AoSHZnx2G3Z0SehmLK X-Received: by 2002:a05:6830:1dfa:: with SMTP id b26mr5121011otj.13.1586347471856; Wed, 08 Apr 2020 05:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586347471; cv=none; d=google.com; s=arc-20160816; b=02ZJtx2AXgP4heHA6Fj5gRJ5XvnOwtMslUglOP85+9IU12MaX4txEYSZQ+56ZiVtlL LIWNDcJLXbTvmPQ+iyADzO/ou/C0oJlOYBWdaYVbSwQ/4oWBK5CcvOGEAVP4ji+whVSV WGDvoP3gYFB1knO2os+D3qZM8ztHswew2wUV5Ij2xwxGRkZWQ18/mAw1kuujtBPtEWgK ZeSxtIp0BaUzTJQTjr4npJx1W6vnPUqsCG5foeVhXPlrcoNzONegOihZM8CJnLe2dAxr tle8WAgmZ+Z2cU7B543yB2mb73RBvsD/TNm2txZPlYEhgVpPd4V1uO3KQOOL4MRF1SFE YieQ== 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=4U1iKOw50X5F7sLfbffdNr/oQo916uVwGgBCPvC/ZCo=; b=tyAp9DnGxS9e4ApH3eJyvO4AezY7wdtg8Dc/eHI73Fc1K4Sb6hJC+WSgzoknxO4iVJ L4hnJ4kLPtuspquPl4Zd+Kw+o8g7G8HA6XZhlmiM4QRjeZsA7ydkIjrTtZUeHXFZiO13 pfoyXEhwEX0TK9/PAxI53Nyjt9mZRaUDSU4hP7REaMTJPkkurdVdpPH0AhRZfP6b3zsw 11h6zrFF6n7LjmTNcDL88nUXTQjWB33J+ric9OX5BqKCL6obQ2tl/G4Pdo1Xu+XyPaGC 7+kkdUBZQ/cf9CXk3kr7BvJjZNAaFQmJtZKz43+z0WJz2y1nbf0qFqYwnA+H56SkMmM/ X2FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=IEmju9hx; 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 l5si2609131otk.62.2020.04.08.05.04.03; Wed, 08 Apr 2020 05:04:31 -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=IEmju9hx; 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 S1728654AbgDHMBn (ORCPT + 99 others); Wed, 8 Apr 2020 08:01:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51544 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729006AbgDHMBL (ORCPT ); Wed, 8 Apr 2020 08:01:11 -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=4U1iKOw50X5F7sLfbffdNr/oQo916uVwGgBCPvC/ZCo=; b=IEmju9hxHqL0bUFKGE/y3g8QcX Pd4bg96eT+t2egee9jGVIDEA6aNxIB/2MZRGCwMyTdZ7C329txLYLQv2oVq5v0vtXWmnzaEgtq+1c tKt0f15rz207sYf2ScT1LvhzFTWMsnzvoZIqub4g9kOPb5GmFI1ZalC54VVBJ6xGRvmUaRyBCrFeP 1ZDmctKbR8OwfXhileD5Lv6NXu5UcrSbJaeO5L5nnK6//EyCOq2xIan96Dxv7/8W/Ladw1ZQne+I5 pOEcAK/oU4CADKLFuPfVNZeL5TPbZ3d8dYy2eGrL3uzPasd7/PyfPvtRzGXKV7jf2iosXoE5Sni2Y e9OFiaDw==; 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 1jM9Nz-0005ff-AR; Wed, 08 Apr 2020 12:00:51 +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 23/28] mm: remove __vmalloc_node_flags_caller Date: Wed, 8 Apr 2020 13:59:21 +0200 Message-Id: <20200408115926.1467567-24-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 Just use __vmalloc_node instead which gets and extra argument. To be able to to use __vmalloc_node in all caller make it available outside of vmalloc and implement it in nommu.c. Signed-off-by: Christoph Hellwig --- include/linux/vmalloc.h | 4 ++-- kernel/bpf/syscall.c | 5 ++--- mm/nommu.c | 4 ++-- mm/util.c | 2 +- mm/vmalloc.c | 10 +--------- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 4a46d296e70d..108f49b47756 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -115,8 +115,8 @@ extern void *__vmalloc_node_range(unsigned long size, unsigned long align, unsigned long start, unsigned long end, gfp_t gfp_mask, pgprot_t prot, unsigned long vm_flags, int node, const void *caller); -extern void *__vmalloc_node_flags_caller(unsigned long size, - int node, gfp_t flags, void *caller); +void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask, + int node, const void *caller); extern void vfree(const void *addr); extern void vfree_atomic(const void *addr); diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 64783da34202..48d98ea8fad6 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -299,9 +299,8 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) return vmalloc_user_node_flags(size, numa_node, GFP_KERNEL | __GFP_RETRY_MAYFAIL | flags); } - return __vmalloc_node_flags_caller(size, numa_node, - GFP_KERNEL | __GFP_RETRY_MAYFAIL | - flags, __builtin_return_address(0)); + return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_RETRY_MAYFAIL | flags, + numa_node, __builtin_return_address(0)); } void *bpf_map_area_alloc(u64 size, int numa_node) diff --git a/mm/nommu.c b/mm/nommu.c index 9553efa59787..81a86cd85893 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -150,8 +150,8 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask) } EXPORT_SYMBOL(__vmalloc); -void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, - void *caller) +void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask, + int node, const void *caller) { return __vmalloc(size, flags); } diff --git a/mm/util.c b/mm/util.c index 988d11e6c17c..6d5868adbe18 100644 --- a/mm/util.c +++ b/mm/util.c @@ -580,7 +580,7 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node) if (ret || size <= PAGE_SIZE) return ret; - return __vmalloc_node_flags_caller(size, node, flags, + return __vmalloc_node(size, 1, flags, node, __builtin_return_address(0)); } EXPORT_SYMBOL(kvmalloc_node); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 3d59d848ad48..ae8249ef5821 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2400,8 +2400,6 @@ 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, int node, const void *caller); static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot, int node) { @@ -2552,7 +2550,7 @@ 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, +void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask, int node, const void *caller) { return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END, @@ -2566,12 +2564,6 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask) } EXPORT_SYMBOL(__vmalloc); -void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, - void *caller) -{ - return __vmalloc_node(size, 1, flags, node, caller); -} - /** * vmalloc - allocate virtually contiguous memory * @size: allocation size -- 2.25.1