lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6bd3b0083427c6cf1c860a021e097af9052cdd75.camel@redhat.com>
Date:   Tue, 01 Mar 2022 11:59:20 +0100
From:   Nicolas Saenz Julienne <nsaenzju@...hat.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     bristot@...nel.org, paulmck@...nel.org, mingo@...hat.com,
        linux-kernel@...r.kernel.org, mtosatti@...hat.com
Subject: Re: [PATCH] tracing/osnoise: Force quiescent states while tracing

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@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ