From patchwork Thu Sep 21 10:45:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13393855 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 49C49E70718 for ; Thu, 21 Sep 2023 11:01:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5A2A6B0208; Thu, 21 Sep 2023 07:01:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB9D46B0209; Thu, 21 Sep 2023 07:01:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D0536B020A; Thu, 21 Sep 2023 07:01:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8A8EC6B0208 for ; Thu, 21 Sep 2023 07:01:08 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5637AC091C for ; Thu, 21 Sep 2023 11:01:08 +0000 (UTC) X-FDA: 81260312616.29.BA87800 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf11.hostedemail.com (Postfix) with ESMTP id 675254001B for ; Thu, 21 Sep 2023 11:01:05 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=ViAEDbVG; dmarc=none; spf=none (imf11.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=1695294065; a=rsa-sha256; cv=none; b=G1nfh4+jDRFZnfzHdTEwS7cjTocusvGOq6P4mWM5Seld5F9n6zsXH7VTH6fFRUcToBiyuK aJ1rS+c87yA0ZdkNhkSNeHPG6WYfevUNPQhGpAdyyuLyHRgpIVKFqW+2KQ0uW7a8ZvEWNe wbELpkKz6fOJuspVQCL1gTGlUyTtIUQ= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=ViAEDbVG; dmarc=none; spf=none (imf11.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=1695294065; 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=+WIdohk1HL2nzrHveE43px5IkTjGhV/7JBkH2s5C174=; b=khN+rxFEkYQmNMkyhgAwRCG8RClH5ZndRUM2HuhmO5IOmFWLw7YM1eLa7qFRsbNEmvTnHX Y5oIOzPV+Ftgc2TUrBmNeOtGsUxgTsHRgwBePwiK2c5EZHSUWujTXBdQPZgK6Lpsob7OaF 3MR7KqKyAIXQNXVSqUChFJENDrZG334= 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=+WIdohk1HL2nzrHveE43px5IkTjGhV/7JBkH2s5C174=; b=ViAEDbVGOlyxSg3ebF8KxwAziD ZJXxCIy42X12v4Mep2vVxljFUC4bpie4jrjZc5b7y0aR/AFBwBx8QQf7IyrWb6in0/ZjL0xzIPnSx pb6UQGfcsxlZIGeiFtjBChv2JNIQwRXxcHOt6/36MAnZlaHZe1+0fz5A4w/a/h9G+i1YiZoOjLNE4 OwpOyR+wNSWxm0UFxB37sVSQEBBvFtN6ftl6Pn5yJIMtEP7rAmx4bdY6aw54FXq2amDzF8WCOnnaP MIOPlPb7NIN0RqyDlWXr9vkr9PkW1Y4MN8g0z/WF3CPS10TmZ2L6+1wJRYHnIB47xz4TyxFPPPHSd HzrBon7A==; 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 1qjHQN-00FJvv-1Z; Thu, 21 Sep 2023 11:00:59 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 15CCD30067A; Thu, 21 Sep 2023 13:00:43 +0200 (CEST) Message-Id: <20230921105248.683656626@noisy.programming.kicks-ass.net> User-Agent: quilt/0.65 Date: Thu, 21 Sep 2023 12:45:16 +0200 From: peterz@infradead.org 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 v3 11/15] mm: Add vmalloc_huge_node() References: <20230921104505.717750284@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline; filename=peterz-vmalloc_huge_node.patch X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 675254001B X-Stat-Signature: kmkbabm95ze991gp87s9hmbmmmkmrffa X-HE-Tag: 1695294065-600994 X-HE-Meta: U2FsdGVkX18itry9AVRmbLajxxsAAkHHfmOH8mfaVEyr51v2NkdUbSfHfndZFiNIP+bhAYKerpnfxHQ6Qs1otSWBsm20ilUSorKiVe63AqNUBoZlL3c34RkZ5mwoLIq9d/48bGQawIyXGPxJRIE8loMM5VxnVyD8T8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1AeSNwZaIwcRMd7pmMqy+5G4kUFa9hA== 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(+) Index: linux-2.6/include/linux/vmalloc.h =================================================================== --- linux-2.6.orig/include/linux/vmalloc.h +++ linux-2.6/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); Index: linux-2.6/mm/vmalloc.c =================================================================== --- linux-2.6.orig/mm/vmalloc.c +++ linux-2.6/mm/vmalloc.c @@ -3420,6 +3420,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