Re: [GIT PULL] last minute percpu fix for v3.15-rc8

From: Tejun Heo
Date: Wed Jun 04 2014 - 14:13:02 EST


Hello,

On Wed, Jun 04, 2014 at 12:16:56PM -0500, Christoph Lameter wrote:
> On Wed, 4 Jun 2014, Tejun Heo wrote:
>
> > I'll ping Christoph whether __this_cpu_*() ops can be better annotated
> > so that it can trigger lockdep warning when used from multiple
> > contexts.
>
> We just added checks that verify the proper preemption mode for
> __this_cpu operations. That did not catch it?

That one just ensures that __this_cpu_*() are called with preemption
disabled. What's necessary is tracking whether each percpu variable
is operated on from different contexts so that things like
"inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage" lockdep warnings
can be triggered in cases like this.

Given that percpu operations can be performed on any allocated percpu
area, it's a bit difficult to achieve tho. The only way I can think
of is percpu allocator creating lockdep key for all the allocated
offsets which isn't too enticing. :(

Thanks.

--
tejun
--
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/