Re: [PATCH 1/2] lockdep: implement full check without irq checking

From: Peter Zijlstra
Date: Wed Oct 29 2008 - 14:03:13 EST


On Thu, 2008-10-23 at 21:44 +0200, Johannes Berg wrote:
> This patch implements a new check type "3" which means "full validation
> but without irq tracing" in order to allow some certain fake locks that
> are only added for deadlock detection to not cause inconsistent state
> warnings which would be inappropriate for them.

This thing worries me, can you help my exhausted brain a long a little..

So I take it the idea is to couple the lock chains of the site calling
del_timer_sync and the actual timer.

We do this by holding a fake lock while executing the timer, so that its
lock chain starts with that lock.

We then acquire the fake lock on del_timer_sync so as to establish a
relation.

Now you get warnings about using a lock in hardirq context that was
previously used !irq-safe, right?

So why not simply write something like:


del_timer_sync():

local_irq_save(flags);
lock_aquire(my fake timer lock);
lock_release(...);
local_irq_restore(flags);

and make that conditional CONFIG_PROVE_LOCKING and or wrap it up
somewhere..



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