All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: hugh@veritas.com
Cc: jeremy@goop.org, torvalds@linux-foundation.org,
	a.p.zijlstra@chello.nl, mingo@elte.hu,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] lockdep: lock_set_subclass - reset a held lock's subclass
Date: Fri, 01 Aug 2008 16:20:13 -0700 (PDT)	[thread overview]
Message-ID: <20080801.162013.06459319.davem@davemloft.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0808012051380.6485@blonde.site>

From: Hugh Dickins <hugh@veritas.com>
Date: Fri, 1 Aug 2008 20:59:08 +0100 (BST)

> On Fri, 1 Aug 2008, Jeremy Fitzhardinge wrote:
> > 
> > I have a function traversing a pagetable in vaddr order (low to high), taking
> > pte locks as it builds up batches of pte page updates.  When the batch is
> > issued, it releases all the locks, and won't end up holding more than ~16 at a
> > time.
> > 
> > So, I think this is OK.  There are no internal lock ordering issues, and I
> > don't think there'll be any bad interactions from someone trying to take pte
> > locks for two separate pagetables.  I don't think there's anyone else trying
> > to take more than one pte lock at once, but if there were "lock low vaddr then
> > high" seems like a reasonable locking rule (or more precisely "lowest" to deal
> > with the case of a pte page being aliased at multiple vaddrs).
> 
> Please check the spin_lock_nested() in move_ptes() in mm/mremap.c.

It won't work because spin_lock_nested() is limited to a depth
of 8 and he aparently needs 16.

Taking more than a few locks of the same class at once is bad
news and it's better to find an alternative method.


  parent reply	other threads:[~2008-08-01 23:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 21:43 [git pull] scheduler fixes Ingo Molnar
2008-07-31 22:04 ` David Miller
2008-07-31 22:26   ` Ingo Molnar
2008-07-31 22:55     ` David Miller
2008-08-01  8:11       ` David Miller
2008-08-01  9:01         ` Ingo Molnar
2008-08-01  9:13           ` David Miller
2008-08-01 11:08             ` [PATCH] lockdep: lock_set_subclass - reset a held lock's subclass Peter Zijlstra
2008-08-01 18:06               ` Jeremy Fitzhardinge
2008-08-01 18:14                 ` Linus Torvalds
2008-08-01 19:10                   ` Jeremy Fitzhardinge
2008-08-01 19:24                     ` Linus Torvalds
2008-08-01 20:08                       ` Jeremy Fitzhardinge
2008-08-01 19:59                     ` Hugh Dickins
2008-08-01 20:22                       ` Jeremy Fitzhardinge
2008-08-01 20:33                         ` Hugh Dickins
2008-08-01 23:20                       ` David Miller [this message]
2008-08-01 23:26                         ` Linus Torvalds
2008-08-01 20:49                 ` Peter Zijlstra
2008-08-01 11:08             ` [PATCH] lockdep: re-annotate scheduler runqueues Peter Zijlstra
2008-08-01 17:04               ` Linus Torvalds
2008-08-02  8:34               ` David Miller

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=20080801.162013.06459319.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.