From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
To: "Paul E . McKenney" <paulmck@kernel.org>,
Vlastimil Babka <vbabka@suse.cz>
Cc: RCU <rcu@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
Neeraj upadhyay <Neeraj.Upadhyay@amd.com>,
Boqun Feng <boqun.feng@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>,
Frederic Weisbecker <frederic@kernel.org>,
Uladzislau Rezki <urezki@gmail.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: [PATCH 2/4] rcu/kvfree: Add a switcher for dynamic rcu_head
Date: Wed, 28 Aug 2024 13:09:27 +0200 [thread overview]
Message-ID: <20240828110929.3713-2-urezki@gmail.com> (raw)
In-Reply-To: <20240828110929.3713-1-urezki@gmail.com>
Add a sysfs attribute to control whether a dynamically
rcu_head should be attached or not. It can be controlled
via "/sys/module/rcutree/parameters/use_dyn_rcu_head".
By default it is OFF.
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
kernel/rcu/tree.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 0124411fecfb..893ee69d4a4b 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -206,6 +206,9 @@ module_param(rcu_min_cached_objs, int, 0444);
static int rcu_delay_page_cache_fill_msec = 5000;
module_param(rcu_delay_page_cache_fill_msec, int, 0444);
+static bool use_dyn_rcu_head __read_mostly;
+module_param(use_dyn_rcu_head, bool, 0444);
+
/* Retrieve RCU kthreads priority for rcutorture */
int rcu_get_gp_kthreads_prio(void)
{
@@ -3814,6 +3817,9 @@ attach_rcu_head_to_object(void *obj)
{
struct dyn_rcu_head *rhp;
+ if (!use_dyn_rcu_head)
+ return NULL;
+
rhp = kmalloc(sizeof(struct dyn_rcu_head), GFP_KERNEL |
__GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
--
2.39.2
next prev parent reply other threads:[~2024-08-28 11:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 11:09 [PATCH 1/4] rcu/kvfree: Support dynamic rcu_head for single argument objects Uladzislau Rezki (Sony)
2024-08-28 11:09 ` Uladzislau Rezki (Sony) [this message]
2024-08-28 11:09 ` [PATCH 3/4] rcu/kvfree: Use polled API in a slow path Uladzislau Rezki (Sony)
2024-08-28 11:09 ` [PATCH 4/4] rcu/kvfree: Switch to expedited version in " Uladzislau Rezki (Sony)
2024-08-28 14:58 ` [PATCH 1/4] rcu/kvfree: Support dynamic rcu_head for single argument objects Vlastimil Babka
2024-08-28 17:00 ` Uladzislau Rezki
2024-08-28 18:00 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240828110929.3713-2-urezki@gmail.com \
--to=urezki@gmail.com \
--cc=Neeraj.Upadhyay@amd.com \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksiy.avramchenko@sony.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox