[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4708F5FF.8090104@goop.org>
Date: Sun, 07 Oct 2007 08:06:39 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: Ingo Molnar <mingo@...e.hu>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: lockdep: how to tell it multiple pte locks is OK?
Peter Zijlstra wrote:
>>
>> I presume this is because I'm holding multiple pte locks (class
>> "__pte_lockptr(new)"). Is there some way I can tell lockdep this is OK?
>>
>
> Yeah, the typical way is to use spin_lock_nested(lock, nesting_level),
> this allows one to annotate these nestings. However, nesting_level must
> not be larger than 8, so if your batch is larger than that, we have a
> problem.
>
Yeah, my batches are up to about 32.
>> I'm presume I'm the first person to try holding multiple pte locks at
>> once, so there's no existing locking order for these locks.
>>
>
> Not quite, things like copy_pte_range() take 2.
>
Hm, and it uses SINGLE_DEPTH_NESTING...
>> I'm always
>> traversing and locking the pagetable in virtual address order (and this
>> seems like a sane-enough rule for anyone else who wants to hold multiple
>> pte locks).
>>
>
> I'm quite sure copy_pte_range() could be used so that it violates that
> order.
>
Good point. It's not a problem for me because they're two ptes in
different pagetables, whereas my multiple ptes are always within the
same pagetable. Someone wanting to lock multiple ptes from multiple
pagetables would have a more complex locking order problem.
(Or if we end up sharing ptes between pagetables it might get tricky.)
J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists