mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Zqiang <qiang1.zhang@intel.com>
Cc: paulmck@kernel.org, frederic@kernel.org, rcu@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu: Make call_rcu() lazy only when CONFIG_RCU_LAZY is enabled
Date: Wed, 19 Oct 2022 08:12:30 -0400	[thread overview]
Message-ID: <F24713AB-9AC8-494F-A677-D52C9CE591CF@joelfernandes.org> (raw)
In-Reply-To: <B3E5FB1F-3184-4C56-8B11-6F422DBF1B53@joelfernandes.org>



> On Oct 19, 2022, at 8:10 AM, Joel Fernandes <joel@joelfernandes.org> wrote:
> 
> 
> 
>> On Oct 19, 2022, at 6:34 AM, Zqiang <qiang1.zhang@intel.com> wrote:
>> 
>> Currently, regardless of whether the CONFIG_RCU_LAZY is enabled,
>> invoke the call_rcu() is always lazy, it also means that when
>> CONFIG_RCU_LAZY is disabled, invoke the call_rcu_flush() is also
>> lazy. therefore, this commit make call_rcu() lazy only when
>> CONFIG_RCU_LAZY is enabled.
>> 
>> Signed-off-by: Zqiang <qiang1.zhang@intel.com>
>> ---
>> kernel/rcu/tree.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
>> index abc615808b6e..97ef602da3d5 100644
>> --- a/kernel/rcu/tree.c
>> +++ b/kernel/rcu/tree.c
>> @@ -2839,7 +2839,6 @@ void call_rcu_flush(struct rcu_head *head, rcu_callback_t func)
>>   return __call_rcu_common(head, func, false);
>> }
>> EXPORT_SYMBOL_GPL(call_rcu_flush);
>> -#endif
>> 
>> /**
>> * call_rcu() - Queue an RCU callback for invocation after a grace period.
>> @@ -2890,6 +2889,13 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func)
>>   return __call_rcu_common(head, func, true);
>> }
>> EXPORT_SYMBOL_GPL(call_rcu);
>> +#else
>> +void call_rcu(struct rcu_head *head, rcu_callback_t func)
>> +{
>> +    return __call_rcu_common(head, func, false);
> 
> Thanks. Instead of adding new function, you can also pass IS_ENABLED(CONFIG…) to the existing function of the same name.
> 
> Looks like though I made every one test the patch without having to enable the config option ;-). Hey, I’m a half glass full kind of guy, why do you ask?
> 
> Paul, I’ll take a closer look once I’m at the desk, but would you prefer to squash a diff into the existing patch, or want a new patch altogether?

On the other hand, what I’d want is to nuke the config option altogether or make it default y, we want to catch issues sooner than later.

Thanks.

> 
> Thanks.
> 
> - Joel
> 
> 
>> +}
>> +EXPORT_SYMBOL_GPL(call_rcu);
>> +#endif
>> 
>> /* Maximum number of jiffies to wait before draining a batch. */
>> #define KFREE_DRAIN_JIFFIES (5 * HZ)
>> -- 
>> 2.25.1
>> 

  reply	other threads:[~2022-10-19 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 10:40 Zqiang
2022-10-19 12:10 ` Joel Fernandes
2022-10-19 12:12   ` Joel Fernandes [this message]
2022-10-19 17:44     ` Paul E. McKenney
2022-10-19 18:25       ` Joel Fernandes
2022-10-19 23:21         ` Zhang, Qiang1
2022-10-19 23:34         ` Paul E. McKenney
2022-10-20  8:42           ` Joel Fernandes
2022-10-20 18:39             ` Paul E. McKenney
2022-10-20 18:46               ` Joel Fernandes
2022-10-20 21:33                 ` Joel Fernandes
2022-10-20 22:17                   ` 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=F24713AB-9AC8-494F-A677-D52C9CE591CF@joelfernandes.org \
    --to=joel@joelfernandes.org \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang1.zhang@intel.com \
    --cc=rcu@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®