lkml.org 
[lkml]   [2019]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2019-05-29 15:51    [W:0.174 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site