Re: [RFC PATCH 2/4] sched: Use traced preempt count operations to toggle PREEMPT_ACTIVE

Steven Rostedt
2015-01-28T01:42:45Z

On Wed, 28 Jan 2015 01:24:10 +0100
Frederic Weisbecker <fweisbec@gmail.com> wrote:

> d1f74e20b5b064a130cd0743a256c2d3cfe84010 turned PREEMPT_ACTIVE modifiers
> to use raw untraced preempt count operations. Meanwhile this prevents
> from debugging and tracing preemption disabled if we pull that
> responsibility to schedule() callers (see following patches).
>
> Is there anything we can do about that?
>

I'm trying to understand how you solved the recursion issue with
preempt_schedule()?

Here's what happens:

preempt_schedule()
preempt_count_add() -> gets traced by function tracer
function_trace_call()
preempt_disable_notrace()
[...]
preempt_enable_notrace() -> sees NEED_RESCHED set
preempt_schedule()
preempt_count_add() -> gets traced
function_trace_call()
preempt_disable_notrace()
preempt_enable_notrace() -> sees NEED_RESCHED set

[etc etc until BOOM!]

Perhaps if you can find a way to clear NEED_RECHED before disabling
preemption, then it would work. But I don't see that in the patch
series.

-- Steve