[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130527080019.GD2781@laptop>
Date: Mon, 27 May 2013 10:00:19 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Maarten Lankhorst <maarten.lankhorst@...onical.com>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
x86@...nel.org, dri-devel@...ts.freedesktop.org,
linaro-mm-sig@...ts.linaro.org, robclark@...il.com,
rostedt@...dmis.org, tglx@...utronix.de, mingo@...e.hu,
linux-media@...r.kernel.org, Dave Airlie <airlied@...hat.com>
Subject: Re: [PATCH v3 2/3] mutex: add support for wound/wait style locks, v3
On Wed, May 22, 2013 at 07:24:38PM +0200, Maarten Lankhorst wrote:
> >> +- Functions to only acquire a single w/w mutex, which results in the exact same
> >> + semantics as a normal mutex. These functions have the _single postfix.
> > This is missing rationale.
> trylock_single is useful when iterating over a list, and you want to evict a bo, but only the first one that can be acquired.
> lock_single is useful when only a single bo needs to be acquired, for example to lock a buffer during mmap.
OK, so given that its still early, monday and I haven't actually spend
much time thinking on this; would it be possible to make:
ww_mutex_lock(.ctx=NULL) act like ww_mutex_lock_single()?
The idea is that if we don't provide a ctx, we'll get a different
lockdep annotation; mutex_lock() vs mutex_lock_nest_lock(). So if we
then go and make a mistake, lockdep should warn us.
Would that work or should I stock up on morning juice?
--
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