Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-17 Thread Peter Zijlstra
On Fri, Dec 16, 2016 at 02:17:25PM +0100, Nicolai Hähnle wrote: > On 06.12.2016 16:25, Peter Zijlstra wrote: > >On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: > > > >>@@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, > >>unsigned int subclass, > >>

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-17 Thread Peter Zijlstra
On Fri, Dec 16, 2016 at 02:17:25PM +0100, Nicolai Hähnle wrote: > On 06.12.2016 16:25, Peter Zijlstra wrote: > >On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: > > > >>@@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, > >>unsigned int subclass, > >>

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-16 Thread Maarten Lankhorst
Op 16-12-16 om 14:17 schreef Nicolai Hähnle: > On 06.12.2016 16:25, Peter Zijlstra wrote: >> On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: >> >>> @@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, >>> unsigned int subclass, >>> struct mutex_waiter

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-16 Thread Maarten Lankhorst
Op 16-12-16 om 14:17 schreef Nicolai Hähnle: > On 06.12.2016 16:25, Peter Zijlstra wrote: >> On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: >> >>> @@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, >>> unsigned int subclass, >>> struct mutex_waiter

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-16 Thread Nicolai Hähnle
On 06.12.2016 16:25, Peter Zijlstra wrote: On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: @@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, struct mutex_waiter waiter; unsigned long flags; bool first =

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-16 Thread Nicolai Hähnle
On 06.12.2016 16:25, Peter Zijlstra wrote: On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: @@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, struct mutex_waiter waiter; unsigned long flags; bool first =

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-06 Thread Peter Zijlstra
On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: > @@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, > unsigned int subclass, > struct mutex_waiter waiter; > unsigned long flags; > bool first = false; > - struct ww_mutex *ww; >

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-06 Thread Peter Zijlstra
On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: > @@ -640,10 +640,11 @@ __mutex_lock_common(struct mutex *lock, long state, > unsigned int subclass, > struct mutex_waiter waiter; > unsigned long flags; > bool first = false; > - struct ww_mutex *ww; >

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-06 Thread Peter Zijlstra
On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: > +++ b/include/linux/ww_mutex.h > @@ -222,11 +222,7 @@ extern int __must_check > __ww_mutex_lock_interruptible(struct ww_mutex *lock, > */ > static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx > *ctx) >

Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-06 Thread Peter Zijlstra
On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote: > +++ b/include/linux/ww_mutex.h > @@ -222,11 +222,7 @@ extern int __must_check > __ww_mutex_lock_interruptible(struct ww_mutex *lock, > */ > static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx > *ctx) >

[PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-01 Thread Nicolai Hähnle
From: Nicolai Hähnle We will add a new field to struct mutex_waiter. This field must be initialized for all waiters if any waiter uses the ww_use_ctx path. So there is a trade-off: Keep ww_mutex locking without a context on the faster non-use_ww_ctx path, at the cost

[PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when locking without a context

2016-12-01 Thread Nicolai Hähnle
From: Nicolai Hähnle We will add a new field to struct mutex_waiter. This field must be initialized for all waiters if any waiter uses the ww_use_ctx path. So there is a trade-off: Keep ww_mutex locking without a context on the faster non-use_ww_ctx path, at the cost of adding the