From patchwork Fri Jul 14 13:39:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13313724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA23BEB64DC for ; Fri, 14 Jul 2023 14:16:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 156458D0008; Fri, 14 Jul 2023 10:16:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 086EF8D0001; Fri, 14 Jul 2023 10:16:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD5B18D0008; Fri, 14 Jul 2023 10:16:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A12908D0005 for ; Fri, 14 Jul 2023 10:16:33 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 70C01C02B3 for ; Fri, 14 Jul 2023 14:16:33 +0000 (UTC) X-FDA: 81010417866.05.FBEEF9D Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf15.hostedemail.com (Postfix) with ESMTP id 7E8D9A0019 for ; Fri, 14 Jul 2023 14:16:31 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=X9gijMCm; spf=none (imf15.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689344191; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:references:dkim-signature; bh=vd7IZ5Q9sG2aEX5C+B5mpNsAgNCXrsR4bE5i4Du1qnc=; b=cDvjgF2mr/cCz6sQlp9/yLASjSpdEFGVvLcf+n1GkAIf+P0GSfgGb0r7Su47tZOv2EUOh2 ZEaNvwWmmp04m4gPHvRax/cJJZEelVmNJp0dqaHs9cdqTmaxxDdS0DrTTrWzmmkUmKzwYS 6Hdj/VbaQNotvB1IL8K/wB+l/pc8kpo= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=X9gijMCm; spf=none (imf15.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689344191; a=rsa-sha256; cv=none; b=icKeZtcc3klNxFgV48aP4XRbuR1w5xYFWrhAX7IEGyWAKV/HglYbtejz5HypxBeGUZWifY a/V96nLLF/xUtTjaRnXgDyCaCL8WZmC/gkUY3aOqQsyog1I52pf4f1fBKqhKvvR5jGQysn wVyyv2C+lVf8VU+xoqGVLTII4OmUKyI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=vd7IZ5Q9sG2aEX5C+B5mpNsAgNCXrsR4bE5i4Du1qnc=; b=X9gijMCmfaPrSsayyWL0NuHiOe pGOhwRRTPBsZ40IXNFRORyzItcRWv4X+M3D/uQhswBiY0asbLlff6VJbJ0JHPEZfFMXjzmVs0I3h2 zIKqL8xHXO1+pjyWMBoxtpmq/8rxGe7cTHGeZ59jD2gdh/RhQ1gSNvuGbpNqbMkv4kEbOqjxxt/Bk BXDNnfyaPMAZRHuxBHH6Wfgfjrb5LqQ6zKpgZIsXsl9TYZBQrbC9LXYFJBv8YGZQfOAumvP+LAfQH DKKaLDkbVrzm/PSaPiAwV1U7mLa+G0455XJv/+IXRtYsqpaPxRb6KOlKfb+F71dSxkGZZpqg+7ydQ MafKW0bA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qKJah-006Iiz-2D; Fri, 14 Jul 2023 14:16:16 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B2786300C88; Fri, 14 Jul 2023 16:16:14 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 72FA0213728B8; Fri, 14 Jul 2023 16:16:13 +0200 (CEST) Message-ID: <20230714141218.947137012@infradead.org> User-Agent: quilt/0.66 Date: Fri, 14 Jul 2023 15:39:04 +0200 From: Peter Zijlstra To: tglx@linutronix.de, axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, dvhart@infradead.org, dave@stgolabs.net, andrealmeid@igalia.com, Andrew Morton , urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com, Arnd Bergmann , linux-api@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, malteskarupke@web.de Subject: [RFC][PATCH 05/10] mm: Add vmalloc_huge_node() References: <20230714133859.305719029@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 7E8D9A0019 X-Rspam-User: X-Stat-Signature: beyzg51tt4mdqn5c8tgkw8x1s3gsjuqp X-Rspamd-Server: rspam01 X-HE-Tag: 1689344191-179349 X-HE-Me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mBZHiUa1XDZa/ScTHoi6c6nrgZNr+vfEjMN1jfN+M8FWmZSVIGNV8BmU72s7UFap/NoBC0XN3m/fDiin6s326t56DuG1VOFnUr3k7TZS1jHduMMTeBSAu1UoWwVukjKwp9Mo6sEts64+2UUrwIMcchwyzxc1MDQTqmn8Fnzefac0pT5bxh+K0HmqRy7aJ+mncJi7PCjkD9tmK957IbJdfSy9VF0+F3VqWDc/A2lb35GeDq X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: To enable node specific hash-tables. Signed-off-by: Peter Zijlstra (Intel) --- include/linux/vmalloc.h | 1 + mm/vmalloc.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -152,6 +152,7 @@ extern void *__vmalloc_node_range(unsign void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask, int node, const void *caller) __alloc_size(1); void *vmalloc_huge(unsigned long size, gfp_t gfp_mask) __alloc_size(1); +void *vmalloc_huge_node(unsigned long size, gfp_t gfp_mask, int node) __alloc_size(1); extern void *__vmalloc_array(size_t n, size_t size, gfp_t flags) __alloc_size(1, 2); extern void *vmalloc_array(size_t n, size_t size) __alloc_size(1, 2); --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3416,6 +3416,13 @@ void *vmalloc(unsigned long size) } EXPORT_SYMBOL(vmalloc); +void *vmalloc_huge_node(unsigned long size, gfp_t gfp_mask, int node) +{ + return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END, + gfp_mask, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP, + node, __builtin_return_address(0)); +} + /** * vmalloc_huge - allocate virtually contiguous memory, allow huge pages * @size: allocation size @@ -3430,9 +3437,7 @@ EXPORT_SYMBOL(vmalloc); */ void *vmalloc_huge(unsigned long size, gfp_t gfp_mask) { - return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END, - gfp_mask, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP, - NUMA_NO_NODE, __builtin_return_address(0)); + return vmalloc_huge_node(size, gfp_mask, NUMA_NO_NODE); } EXPORT_SYMBOL_GPL(vmalloc_huge);