[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190529134946.GY2623@hirez.programming.kicks-ass.net>
Date: Wed, 29 May 2019 15:49:46 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Daniel Bristot de Oliveira <bristot@...hat.com>,
linux-kernel@...r.kernel.org, williams@...hat.com,
daniel@...stot.me, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Matthias Kaehlcke <mka@...omium.org>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
Frederic Weisbecker <frederic@...nel.org>,
Yangtao Li <tiny.windzz@...il.com>,
Tommaso Cucinotta <tommaso.cucinotta@...tannapisa.it>
Subject: Re: [RFC 2/3] preempt_tracer: Disable IRQ while starting/stopping
due to a preempt_counter change
On Wed, May 29, 2019 at 09:42:13AM -0400, Steven Rostedt wrote:
> > And the preempt_irqoff tracer had better also consume the IRQ events,
> > and if it does that it can DTRT without extra bits on, even with that
> > race.
> >
> > Consider:
> >
> > preempt_disable()
> > preempt_count += 1;
> > <IRQ>
> > trace_irq_enter();
> >
> > trace_irq_exit();
> > </IRQ>
> > trace_preempt_disable();
> >
> > /* does stuff */
> >
> > preempt_enable()
> > preempt_count -= 1;
> > trace_preempt_enable();
> >
> > You're saying preempt_irqoff() fails to connect the two because of the
> > hole between trace_irq_exit() and trace_preempt_disable() ?
> >
> > But trace_irq_exit() can see the raised preempt_count and set state
> > for trace_preempt_disable() to connect.
>
> That's basically what I was suggesting as the solution to this ;-)
You were wanting changes to preempt_disable() and task_struct, neither
of which is required. The above only needs some per-cpu storage in the
tracer implementation.
Powered by blists - more mailing lists