On Sun, 2014-07-27 at 22:18 -0700, Davidlohr Bueso wrote:
> +static bool mutex_optimistic_spin(struct mutex *lock,
> + struct ww_acquire_ctx *ww_ctx, const bool
> use_ww_ctx)
> +{
> + struct task_struct *task = current;
> +
> + if
On Sun, 2014-07-27 at 22:18 -0700, Davidlohr Bueso wrote:
+static bool mutex_optimistic_spin(struct mutex *lock,
+ struct ww_acquire_ctx *ww_ctx, const bool
use_ww_ctx)
+{
+ struct task_struct *task = current;
+
+ if (!mutex_can_spin_on_owner(lock))
On Mon, 2014-07-28 at 09:39 -0700, Jason Low wrote:
> On Mon, 2014-07-28 at 11:08 +0200, Peter Zijlstra wrote:
> > On Sun, Jul 27, 2014 at 10:18:41PM -0700, Davidlohr Bueso wrote:
> > > +static bool mutex_optimistic_spin(struct mutex *lock,
> > > + struct ww_acquire_ctx
On Mon, 2014-07-28 at 11:08 +0200, Peter Zijlstra wrote:
> On Sun, Jul 27, 2014 at 10:18:41PM -0700, Davidlohr Bueso wrote:
> > +static bool mutex_optimistic_spin(struct mutex *lock,
> > + struct ww_acquire_ctx *ww_ctx, const bool
> > use_ww_ctx)
> > +{
>
>
> > +
On Sun, Jul 27, 2014 at 10:18:41PM -0700, Davidlohr Bueso wrote:
> @@ -180,6 +266,126 @@ static inline int mutex_can_spin_on_owner(struct mutex
> *lock)
>*/
> return retval;
> }
> +
> +/*
> + * Atomically try to take the lock when it is available */
comment fail.
> +static inline
On Sun, Jul 27, 2014 at 10:18:41PM -0700, Davidlohr Bueso wrote:
@@ -180,6 +266,126 @@ static inline int mutex_can_spin_on_owner(struct mutex
*lock)
*/
return retval;
}
+
+/*
+ * Atomically try to take the lock when it is available */
comment fail.
+static inline bool
On Mon, 2014-07-28 at 11:08 +0200, Peter Zijlstra wrote:
On Sun, Jul 27, 2014 at 10:18:41PM -0700, Davidlohr Bueso wrote:
+static bool mutex_optimistic_spin(struct mutex *lock,
+ struct ww_acquire_ctx *ww_ctx, const bool
use_ww_ctx)
+{
+ /*
+* If
On Mon, 2014-07-28 at 09:39 -0700, Jason Low wrote:
On Mon, 2014-07-28 at 11:08 +0200, Peter Zijlstra wrote:
On Sun, Jul 27, 2014 at 10:18:41PM -0700, Davidlohr Bueso wrote:
+static bool mutex_optimistic_spin(struct mutex *lock,
+ struct ww_acquire_ctx *ww_ctx,
When we fail to acquire the mutex in the fastpath, we end up calling
__mutex_lock_common(). A lot goes on in this function. Move out the
optimistic spinning code into mutex_optimistic_spin() and simplify
the former a bit. Furthermore, this is similar to what we have in
rwsems. No logical changes.
When we fail to acquire the mutex in the fastpath, we end up calling
__mutex_lock_common(). A lot goes on in this function. Move out the
optimistic spinning code into mutex_optimistic_spin() and simplify
the former a bit. Furthermore, this is similar to what we have in
rwsems. No logical changes.
10 matches
Mail list logo