lkml.org 
[lkml]   [2008]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] lockdep: implement full check without irq checking
From
Date
On Wed, 2008-10-29 at 16:23 +0100, Peter Zijlstra wrote:

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

Right. Same way as the workqueue code. Mind you, I'm not sure this is
even worth it, in running it I haven't found a bug and I because timer
code may not sleep you can only take spinlocks in them, and I suspect
that it's unlikely somebody will try to cancel_sync a timer under a
spinlock, though it is of course possible.

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

Yeah, that is possible, but it seemed to me that would affect the
performance of del_timer_sync() quite a bit. Not sure it matters. And on
powerpc (which I care about) it won't actually affect performance much
because we lazily disable IRQs, but still. The >= 2 change also seemed
to generate smaller code?

johannes
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2008-10-30 11:39    [W:0.050 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site