From patchwork Mon Aug 7 12:18:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13344118 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 42DFBC10F19 for ; Mon, 7 Aug 2023 12:37:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAD598D0007; Mon, 7 Aug 2023 08:37:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7574F900003; Mon, 7 Aug 2023 08:37:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 338C8900007; Mon, 7 Aug 2023 08:37:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8EA716B0078 for ; Mon, 7 Aug 2023 08:37:10 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3DDCD140A2C for ; Mon, 7 Aug 2023 12:37:10 +0000 (UTC) X-FDA: 81097258620.09.8156FE8 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf09.hostedemail.com (Postfix) with ESMTP id 71675140026 for ; Mon, 7 Aug 2023 12:37:07 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=DIfNmxEY; dmarc=none; spf=none (imf09.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691411827; 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=yhuAOwd3npGJeiWmKJXyciafSAGyeTkzn0KP+zTqoEU=; b=32IyyRaMGj0Yck7fN2LyuzF8BsxeCllRM1zZ9yEb1YWCXpIPdm2gbu/+0AZBVJ0cki/15G KrGv8JHX4racuVI1PPPnjg9PWucHiTBYO/LEhQzEYTFfa249C/kvnAMAJcGi7ylp5EWe9J SXykl6L2FCgmgAWe6rFGkgYr52PBsIE= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=DIfNmxEY; dmarc=none; spf=none (imf09.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691411827; a=rsa-sha256; cv=none; b=RDY11/crF/Zm3m6/27Re0yhMD1aZdYdPufogLE/JF1274qZqQ61tWrbrghs/JpBASmuwti dAlu7j/+TZ3IgH0/3iIAKd3Q57JCu7YExS/DtMYDtG0IA4c6f9h4hClrCaaT1HSt6Q6JmY syh9VsEpYjQNtsdic2jVnINNGv0CwBI= 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=yhuAOwd3npGJeiWmKJXyciafSAGyeTkzn0KP+zTqoEU=; b=DIfNmxEY7NkuxRZGvTBNvETWLd ddtah769bA3DgEscE0yGOSe5I39fPDiu5Mjvo17Y567v9fB2s7UX2zdEL/95eWCfI3b3Q1PhxBfaY LYDstXbDtVxb/OurZOWFFWwWlAgq3BKqt2A4y2gFBkoO5WtEh/Pn60AQf1xOMd9mA8wonY7weYkEp Bx9EOyLBwrEFqUCS0it9omaKgOhmDSlZW0dv+uiZc5hKDPEZXaJU2140Vc2QBw/ncEUVuJibJQxVw lTJr2P9b8KYQTkBIXzNM11ot2CJ4W9zOw6AmQWhQLaNvpx7A5KkfFbaocB0ejMdjiL0f3fMIPCfTt T0c0m83Q==; 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 1qSzTl-003oSl-1d; Mon, 07 Aug 2023 12:36:58 +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 2DAA73033B1; Mon, 7 Aug 2023 14:36:56 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id B72A22021C3DB; Mon, 7 Aug 2023 14:36:54 +0200 (CEST) Message-ID: <20230807123323.434708155@infradead.org> User-Agent: quilt/0.66 Date: Mon, 07 Aug 2023 14:18:53 +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, Christoph Hellwig Subject: [PATCH v2 10/14] mm: Add vmalloc_huge_node() References: <20230807121843.710612856@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 71675140026 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: bbuyw345859uied4juzjqn66zew19gqi X-HE-Tag: 1691411827-647716 X-HE-Meta: U2FsdGVkX19c7OdW6LbkdvgQERA4T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41WaCf97OfGnbhZbRZgFh2NxfXmocVDZZ7ay/EfGrg9zeHoiYKRrJJctMasNfbOOhiJPbEDhHKVE37r4tYKolWUIBEgM2uXKS20eMbqxyOmTHb65iqkDby8jfRAYua3JKImEPiteJ36FFEZdFEBmixbu3s7tjeEEkYwlf9lL9LOwQtNEV0KZYMcY6KgpPs2g/anniZb62OjToOSpdOEOHZc 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) Reviewed-by: Christoph Hellwig --- include/linux/vmalloc.h | 1 + mm/vmalloc.c | 7 +++++++ 2 files changed, 8 insertions(+) --- 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