From patchwork Fri Oct 25 09:03:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13850340 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 20362D0C5F8 for ; Fri, 25 Oct 2024 09:41:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C3916B0092; Fri, 25 Oct 2024 05:41:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96FC16B0095; Fri, 25 Oct 2024 05:41:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 838416B0093; Fri, 25 Oct 2024 05:41:06 -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 5E15B6B008A for ; Fri, 25 Oct 2024 05:41:06 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9DBDDABF64 for ; Fri, 25 Oct 2024 09:40:27 +0000 (UTC) X-FDA: 82711630134.27.EDBE6AB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id 2D99E180008 for ; Fri, 25 Oct 2024 09:40:44 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=McNtDpCw; spf=none (imf16.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729849186; a=rsa-sha256; cv=none; b=vdd0fS9bMM27EoxdYVZr3GWc5gcmFjOxinJ6qvMkOpy5KKCKpi6R6gLnr24awOObW0gcy+ LK+aGqfsS1JAZYhwQcFpmnn2YF50E/OtQlrWtL+Icc5kKVQMe/83HvY71bfQAmxNOI15hc rc8uH0VJofjjgZ+xN7nixLsSQGvvctA= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=McNtDpCw; spf=none (imf16.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) 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=1729849186; 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=0AEHQ3fQNKjih+WCnZnELy/0uqQ93GQb79KeQAZqpzY=; b=Hkqq/JmC7rPQyqL9hIT2N1F0VBA0ZzbluHeh1B4vZl1KX5xJHzKRFFAbz1dBU+W7Hnbpkb xpdN7AqIwS82CHhwMvZwn0kDNqZ1fGvdEN0k+l+eCGEH982mOeCDaww25iFAtQ1V2Gev3V QfmRqQvcwMPZbYi+kycqKGyyWkPckrE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=0AEHQ3fQNKjih+WCnZnELy/0uqQ93GQb79KeQAZqpzY=; b=McNtDpCw6pjIEqx1QyIATJefZK jqyWF8iz8+9HX4WnJpzMD8QeilUseTQ/PQxpt024ZVD/RTbhE2tzhZ+M/+sMzWodfZvKGmRh7vTDY D945hn22VNwRJmsnRB3v9+4WCSKNbd4TATVzNAbtBJt9+x4jkyi5nOYLY1wNL/WNVQVfXYEuvvG2O hPH4rkssuZZjpoq8BUzAO3IwaAYFV0c+9uEE4NgB5vt9Opiyc99u2bFWew65H/TLWbqdFct9PK3lN zEzc6m0D1tLFmVcsU/VQR5xdkfd2KZ5i6yRkA2knj8/7wCTsbUcl606O1YdIYtnxPvDFZ+buX759U aNbpbWRg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1t4GoU-000000054PN-00f2; Fri, 25 Oct 2024 09:40:58 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id CDA73300ABE; Fri, 25 Oct 2024 11:40:57 +0200 (CEST) Message-Id: <20241025093944.372391936@infradead.org> User-Agent: quilt/0.65 Date: Fri, 25 Oct 2024 11:03:48 +0200 From: Peter Zijlstra To: tglx@linutronix.de 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, cl@linux.com, llong@redhat.com, Christoph Hellwig Subject: [PATCH 1/6] mm: Add vmalloc_huge_node() References: <20241025090347.244183920@infradead.org> MIME-Version: 1.0 X-Stat-Signature: yma676gye3sknyrt5crsn364srxjdhe9 X-Rspamd-Queue-Id: 2D99E180008 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1729849244-458027 X-HE-Meta: U2FsdGVkX19mpWxziCaY6vbV6+mqGjYNUebCIWA1xgXWtNRCKg5EmnZMbnxCaF06KmyD2o0A0qzdyQ11UOFeSpkybAzY9gdUnPMFd4BgQ2wGL8XrCt3aLudZLKkbRGUq+V8xAGMJeU9wE6zDO4phP3jfB8BeKt1i/lNuJXJPJXlS+1hYIgTbHd+xU4SNTrBUdv+kQ9f4Cr7fsaxXmd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PSdhvGk+cTkVQ22mk1Tt/F2uLRF4AFLtZCBVWsbukKx4uA== 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: List-Subscribe: List-Unsubscribe: To enable node specific hash-tables. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Christoph Hellwig Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Davidlohr Bueso --- include/linux/vmalloc.h | 3 +++ mm/vmalloc.c | 7 +++++++ 2 files changed, 10 insertions(+) --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -177,6 +177,9 @@ void *__vmalloc_node_noprof(unsigned lon void *vmalloc_huge_noprof(unsigned long size, gfp_t gfp_mask) __alloc_size(1); #define vmalloc_huge(...) alloc_hooks(vmalloc_huge_noprof(__VA_ARGS__)) +void *vmalloc_huge_node_noprof(unsigned long size, gfp_t gfp_mask, int node) __alloc_size(1); +#define vmalloc_huge_node(...) alloc_hooks(vmalloc_huge_node_noprof(__VA_ARGS__)) + extern void *__vmalloc_array_noprof(size_t n, size_t size, gfp_t flags) __alloc_size(1, 2); #define __vmalloc_array(...) alloc_hooks(__vmalloc_array_noprof(__VA_ARGS__)) --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3948,6 +3948,13 @@ void *vmalloc_huge_noprof(unsigned long } EXPORT_SYMBOL_GPL(vmalloc_huge_noprof); +void *vmalloc_huge_node_noprof(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)); +} + /** * vzalloc - allocate virtually contiguous memory with zero fill * @size: allocation size