From patchwork Thu Dec 12 18:02:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13905762 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 5308EE7717F for ; Thu, 12 Dec 2024 18:02:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 681556B0085; Thu, 12 Dec 2024 13:02:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6300C6B0088; Thu, 12 Dec 2024 13:02:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45F036B0089; Thu, 12 Dec 2024 13:02:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0C77C6B0085 for ; Thu, 12 Dec 2024 13:02:18 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B152D120673 for ; Thu, 12 Dec 2024 18:02:17 +0000 (UTC) X-FDA: 82887075348.06.603F9C2 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf03.hostedemail.com (Postfix) with ESMTP id 9F2D720037 for ; Thu, 12 Dec 2024 18:02:04 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jJv1mkAU; spf=pass (imf03.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734026510; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=d17cFn0Xubw7gH2xGZnbhSlLU5gmONRj4+qymf6is0I=; b=LMTc2gVFIj/ulPtTeLIjyc54w2NwOcwvM5x+bSi/uy0P9zoZG684918MiGD7VYn7PRfvPA ezYac2zTbINCu+88GhGLtfv4nL1ulWv0nAY9EgRYHkBQSx3pp/yKbW4K+nT46zGaExwTqF E92VeAEPWkqJOZdzvzm3nWhtYulVG50= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734026510; a=rsa-sha256; cv=none; b=sy6j8vAa08r9JKHcP8mHlNXrYxapl6LTOf0v0fVLftm+1ZEdaBtpHdHRCEERKCQaZFJ9z+ 2S7z6Av8kziTm9zPpbkWNbsJqjE8asG4nOI4luad4I2AfldIB+D3Dabq4kTgoU85eUvwlj dpHbfMyniPiM4CLCJvr3BrfZNG7dKtk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jJv1mkAU; spf=pass (imf03.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5401c52000dso1006169e87.3 for ; Thu, 12 Dec 2024 10:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734026534; x=1734631334; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d17cFn0Xubw7gH2xGZnbhSlLU5gmONRj4+qymf6is0I=; b=jJv1mkAUeS+3lNGuhT1v1ro1BMbPIsTJpX6Hlz7+BpSsO6fL7MSJzd97pZ41xkYd9R bzpH4bJwykoWs4zh1G0YZpv/DrfpI0ix3BpUioveJQX0iNfwFQQ2BAd+0bcSC8+sWccF VOokP1ozDWPdJu1GuUTmHXqspSwWfky/oKdPKPZr98qm1uoyiJwjm+A6jPYMGPq28x5+ ME9yIP9Vte3FrkMzWG9Q4VpRCGAPLE9g4ALdY8Z5v8AHdjg3SrbTOG7FVGdWU4EUXdlV th48+3viVouR2rc4S5JibNOAsUGdfgq8WhadYgIo8m9chbnwBVDiNyeqkql0jxwF1Jcz W6qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734026534; x=1734631334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d17cFn0Xubw7gH2xGZnbhSlLU5gmONRj4+qymf6is0I=; b=rdhy/R5VPufvUAO2b2u0JZYFVuaZOjCGQ571ejCmdHCSgK7Xz6+sYtj2Pw2Vviu2Et KW5soKyjFLuzgcMx9gG3NCHoODqi23JA2pvOZ/inN6aYJSCUsJqRhYl+34KXQWMH/ieO Pq+++4BdCdvUMvkCPVdj01LuDm03s6JYyzt42R+Y4zWBtQlvGkomQF/MxAHZNUkOqzjO pR1PSHldJv6yBXC6exfqNW2DaA1rfauQou7Xl104//sN36tX95NorgoCp8UHndEKzF8b w2/iNZYCSoPk+7bq1FrNiAWOLHfw048jUerhIKgEtKXmXRxgzVWQ2OlZZ9lO/9rao5F1 zsfA== X-Gm-Message-State: AOJu0YwC7tNRd8+R82AYyQotQC0NYxACFYRNP1I/DWLm+T/qI74znwFs hDkpr5UyJpdebLSFGmByTKmvpe9gHj2G2FTjjArQF4CvxC8hfkScIFc5kQ== X-Gm-Gg: ASbGncsPhdvcFeE0MgjvL4cvbLnDkWIjrXuVU61N1q9e/TUH9QIuMls/p2RzAFxTrn+ 8GjNrg/dzVk6Q47xFhRBsLD7v47yXIQrNBaNtJG/Jw/22LMH2SCO3Z38/YjIsI1WGWBX1KWOOxn ctcbpZUlZtM6jG/4tByLA2yxPnPergpylAZJEi3TZDYohGnj3uRMx9wNRrqyKDcDJ37olSBHkYD Jfb0pKiP4QK0lwDAVRS2lH/VZP7XERneKsRmiwnAKD7EhTf9Vqx X-Google-Smtp-Source: AGHT+IGz+p8q2ObIoPlvWL19tlssMjhRoDnjX+5PLTP5UDSV8wGIYh9EGxkPINPkkiRjxhnvXpmUGQ== X-Received: by 2002:a05:6512:3995:b0:53e:3a7c:c0b5 with SMTP id 2adb3069b0e04-54034100d67mr608345e87.10.1734026532195; Thu, 12 Dec 2024 10:02:12 -0800 (PST) Received: from pc638.lan ([2001:9b1:d5a0:a500:2d8:61ff:fec9:d743]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53e39375d36sm1940645e87.7.2024.12.12.10.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 10:02:11 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: linux-mm@kvack.org, "Paul E . McKenney" , Andrew Morton , Vlastimil Babka Cc: RCU , LKML , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH v2 1/5] rcu/kvfree: Initialize kvfree_rcu() separately Date: Thu, 12 Dec 2024 19:02:04 +0100 Message-Id: <20241212180208.274813-2-urezki@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241212180208.274813-1-urezki@gmail.com> References: <20241212180208.274813-1-urezki@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 9F2D720037 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: rzzoy75ph559syehqno1fpmhpgtgz6me X-HE-Tag: 1734026524-931882 X-HE-Meta: U2FsdGVkX19yCyLPsgrIAg62jFfLsSPPcw10ruMXNYZdS+CAPAH7cvhb+FpWTyP+v519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xehM4Ro7N+HXxDSKxGINIy/hlmc6XK2xFrsbLDmeLYkY1KgvPxrR5Y7hoEYFKDOe/rmznefAdkVV7FM3ReVSTxA8mXss4WIfv2A+WVy3uqLRREbylOs+Ydu/M0ZQDsDLKO+iPqVygf1GRDLpPXuP/iJ/wHpqCzTflY8qINGSy8Xss7eTwvld+pkHJv2d9ZqS0qYrLCxx658s5toMl/ZCAGtDk8HHckOrJSGDk683OaCLUNq1iKZ+HJAbkzB7IqSsPbEq0wT5ygUoedsx6RQdX7hdRy6b3BcsVX7NPw0XWLeo0+8ATydneoDocdbqTsA/9AJBHKI7XE092MvSwVkxl7DxMf+/f7YFcS2Mw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000049, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Introduce a separate initialization of kvfree_rcu() functionality. For such purpose a kfree_rcu_batch_init() is renamed to a kvfree_rcu_init() and it is invoked from the main.c right after rcu_init() is done. Signed-off-by: Uladzislau Rezki (Sony) --- include/linux/rcupdate.h | 1 + init/main.c | 1 + kernel/rcu/tree.c | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 48e5c03df1dd..acb0095b4dbe 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -118,6 +118,7 @@ static inline void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func) /* Internal to kernel */ void rcu_init(void); +void __init kvfree_rcu_init(void); extern int rcu_scheduler_active; void rcu_sched_clock_irq(int user); diff --git a/init/main.c b/init/main.c index 00fac1170294..893cb77aef22 100644 --- a/init/main.c +++ b/init/main.c @@ -992,6 +992,7 @@ void start_kernel(void) workqueue_init_early(); rcu_init(); + kvfree_rcu_init(); /* Trace events are available after this */ trace_init(); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index ff98233d4aa5..e69b867de8ef 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -5648,7 +5648,7 @@ static void __init rcu_dump_rcu_node_tree(void) struct workqueue_struct *rcu_gp_wq; -static void __init kfree_rcu_batch_init(void) +void __init kvfree_rcu_init(void) { int cpu; int i, j; @@ -5703,7 +5703,6 @@ void __init rcu_init(void) rcu_early_boot_tests(); - kfree_rcu_batch_init(); rcu_bootup_announce(); sanitize_kthread_prio(); rcu_init_geometry();