Re: lockdep: how to tell it multiple pte locks is OK?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux