mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzju@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: bristot@kernel.org, paulmck@kernel.org, mingo@redhat.com,
	linux-kernel@vger.kernel.org, mtosatti@redhat.com
Subject: Re: [PATCH] tracing/osnoise: Force quiescent states while tracing
Date: Tue, 01 Mar 2022 11:59:20 +0100	[thread overview]
Message-ID: <6bd3b0083427c6cf1c860a021e097af9052cdd75.camel@redhat.com> (raw)
In-Reply-To: <20220228104523.01eda61a@gandalf.local.home>

On Mon, 2022-02-28 at 10:45 -0500, Steven Rostedt wrote:
> On Mon, 28 Feb 2022 15:14:23 +0100
> Nicolas Saenz Julienne <nsaenzju@redhat.com> wrote:
> 
> > @@ -1386,6 +1389,22 @@ static int run_osnoise(void)
> >  					osnoise_stop_tracing();
> >  		}
> >  
> > +		/*
> > +		 * Check if we're the only ones running on this nohz_full CPU
> > +		 * and that we're on a PREEMPT_RCU setup. If so, let's fake a
> > +		 * QS since there is no way for RCU to know we're not making
> > +		 * use of it.
> > +		 *
> > +		 * Otherwise it'll be done through cond_resched().
> > +		 */
> > +		if (IS_ENABLED(CONFIG_PREEMPT_RCU) &&
> > +		    !housekeeping_cpu(raw_smp_processor_id(), HK_FLAG_MISC) &&
> > +		    tick_nohz_tick_stopped()) {
> > +			local_irq_save(flags);
> > +			rcu_momentary_dyntick_idle();
> > +			local_irq_restore(flags);
> > +		}
> > +
> 
> This looks very specific and a corner case. Something that depends on how
> RCU works. This really should be in the RCU code such that if something
> changes, RCU maintainers are aware of this and can update this too.

The if statement could be relaxed to some extent (I'm looking into it ATM). I
made it more constraining to avoid the overhead for other users.

As for rcu_momentary_dyntick_idle(), I'm not the first one to use it for such
means. See multi_cpu_stop() in kernel/stop_machine.c. So I'm not sure it counts
as abusing RCU internals.

> I wonder if this is similar to what we have in trace_benchmark(). Would
> using: cond_resched_tasks_rcu_qs() work for you?

IIUC this only affects tasks_rcu, and doesn't help with regular RCU. We already
call cond_resched_tasks_rcu_qs() in osnoise when necesary, actually it was
introduced by you. :)

Thanks!

-- 
Nicolás Sáenz


  reply	other threads:[~2022-03-01 10:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 14:14 Nicolas Saenz Julienne
2022-02-28 15:45 ` Steven Rostedt
2022-03-01 10:59   ` Nicolas Saenz Julienne [this message]
2022-03-01 17:30     ` Daniel Bristot de Oliveira
2022-02-28 20:00 ` Daniel Bristot de Oliveira
2022-03-01 10:52   ` Nicolas Saenz Julienne
2022-03-01 17:55     ` Daniel Bristot de Oliveira
2022-03-01 18:05       ` Paul E. McKenney
2022-03-01 18:44         ` Daniel Bristot de Oliveira
2022-03-01 18:58           ` Paul E. McKenney
2022-03-01 19:29             ` Daniel Bristot de Oliveira
2022-03-01 19:46               ` Paul E. McKenney
2022-03-01 19:53                 ` Daniel Bristot de Oliveira
2022-02-28 22:11 ` Paul E. McKenney
2022-03-01 10:00   ` Nicolas Saenz Julienne
2022-03-01 17:44     ` Daniel Bristot de Oliveira
2022-03-01 17:56     ` Paul E. McKenney
2022-03-02 10:46       ` Nicolas Saenz Julienne
2022-03-04 14:28 ` Daniel Bristot de Oliveira
2022-03-04 14:36   ` Nicolas Saenz Julienne
2022-03-04 14:39     ` Daniel Bristot de Oliveira
2022-03-04 14:51     ` Daniel Bristot de Oliveira
2022-03-04 15:28       ` Nicolas Saenz Julienne
2022-03-04 15:37         ` Daniel Bristot de Oliveira
2022-03-04 15:55           ` Nicolas Saenz Julienne
2022-03-04 16:26             ` 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=6bd3b0083427c6cf1c860a021e097af9052cdd75.camel@redhat.com \
    --to=nsaenzju@redhat.com \
    --cc=bristot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.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®