Re: lockdep WARNING for run_timer_softirq()

From: Steven Rostedt
Date: Wed Sep 05 2012 - 15:23:43 EST


On Wed, 2012-09-05 at 19:19 +0200, Peter Zijlstra wrote:
> On Wed, 2012-09-05 at 13:14 -0400, Steven Rostedt wrote:
> >
> > This looks very familiar to Fengguang's previous bug report. I can't
> > seem to find it on LKML.org. Probably because of the two attachments
> > (dmesg and config) caused lkml to nuke it.
> >
> > I'll forward it to you.
>
> Yuck that looks like fun too.. doesn't look like the if() thing though.

I'm able to trigger a similar bug too. And this is what I've found.

between:

lockdep_softirq_exit();
and
__local_bh_enable(SOFTIRQ_OFFSET);

the __local_bh_enable() is being traced, which means we call the
ftrace_ops_list_func() (which is called instead of the direct function
in some configs). This does a:

op = rcu_dereference_raw(ftrace_ops_list);

where rcu_dereference_raw() eventually calls rcu_read_lock_held() which
calls lock_is_held(), and this does the consistency checks, where
lockdep thinks we are no longer in the softirq, but we haven't gotten to
the point in __local_bh_enable() where the preempt_count is decremented
to state this.

But this doesn't look the same as the branch tracer. I'll continue
looking into that one.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/