From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: lockdep: how to tell it multiple pte locks is OK?
Date: Sun, 07 Oct 2007 08:06:39 -0700 [thread overview]
Message-ID: <4708F5FF.8090104@goop.org> (raw)
In-Reply-To: <1191745762.5602.5.camel@lappy>
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
next prev parent reply other threads:[~2007-10-07 15:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-07 6:31 lockdep: how to tell it multiple pte locks is OK? Jeremy Fitzhardinge
2007-10-07 8:29 ` Peter Zijlstra
2007-10-07 15:06 ` Jeremy Fitzhardinge [this message]
2007-10-07 16:58 ` Arjan van de Ven
2007-10-07 17:17 ` Jeremy Fitzhardinge
2007-10-07 17:46 ` Arjan van de Ven
2007-10-09 0:20 ` Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4708F5FF.8090104@goop.org \
--to=jeremy@goop.org \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox