Re: [PATCH 13/20] lockdep, mutex: Provide mutex_lock_nest_lock

From: Peter Zijlstra
Date: Wed Apr 20 2011 - 07:05:30 EST


On Tue, 2011-04-19 at 13:06 -0700, Andrew Morton wrote:
> On Fri, 01 Apr 2011 14:13:11 +0200
> Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:
>
> > Provide the mutex_lock_nest_lock() annotation.
>
> why?
>
> Neither the changelog nor the code provide any documentation for this addition to
> the lokdep API.

---
Subject: lockdep, mutex: Provide mutex_lock_nest_lock
From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Date: Fri, 26 Nov 2010 15:39:00 +0100

In order to convert i_mmap_lock to a mutex we need a mutex equivalent
to spin_lock_nest_lock(), thus provide the mutex_lock_nest_lock()
annotation.

As with spin_lock_nest_lock(), mutex_lock_nest_lock() allows
annotation of the locking pattern where an outer lock serializes the
acquisition order of nested locks. That is, if every time you lock
multiple locks A, say A1 and A2 you first acquire N, the order of
acquiring A1 and A2 is irrelevant.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/