lkml.org 
[lkml]   [2023]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 rcu/dev 2/2] rcu: Disable laziness if lazy-tracking says so
On Sun, Jan 15, 2023 at 3:55 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Thu, 12 Jan 2023 00:52:23 +0000
> "Joel Fernandes (Google)" <joel@joelfernandes.org> wrote:
>
> >
> > static void
> > -__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy)
> > +__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in)
> > {
> > static atomic_t doublefrees;
> > unsigned long flags;
> > struct rcu_data *rdp;
> > - bool was_alldone;
> > + bool was_alldone, lazy;
>
> I'm curious to why the the extra variable.
>
> >
> > /* Misaligned rcu_head! */
> > WARN_ON_ONCE((unsigned long)head & (sizeof(void *) - 1));
> > @@ -2622,6 +2622,7 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy)
> > kasan_record_aux_stack_noalloc(head);
> > local_irq_save(flags);
> > rdp = this_cpu_ptr(&rcu_data);
> > + lazy = lazy_in && !rcu_async_should_hurry();
>
> Wouldn't just having:
>
> lazy = lazy && !rcu_async_should_hurry();
>
> be sufficient?

I prefer to not overwrite function arguments, it makes debugging harder IMHO.

- Joel



>
> -- Steve
>
> >
> > /* Add the callback to our list. */
> > if (unlikely(!rcu_segcblist_is_enabled(&rdp->cblist))) {
> > --

\
 
 \ /
  Last update: 2023-03-26 23:42    [W:0.024 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site