lkml.org 
[lkml]   [2014]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] locking/mutex: Get rid of use_ww_cxt param in common paths
On Sun, Dec 28, 2014 at 01:11:17AM -0800, Davidlohr Bueso wrote:
> ... and simplify a bit the parameters of __mutex_lock_common(). This
> is straightforward as we can just check if the ww cxt for NULL if passed
> from non wait/wound paths.


The reason for this trainwreck is because of some older GCC not actually doing
the const propagation of the MULL pointer right.

There were at least two threads on this,
b0267507dfd0187fb7840a0ec461a510a7f041c5 might give clues.

> static bool mutex_optimistic_spin(struct mutex *lock,
> - struct ww_acquire_ctx *ww_ctx, const bool use_ww_ctx)
> + struct ww_acquire_ctx *ww_ctx)
> {
> struct task_struct *task = current;
>
> @@ -313,7 +313,7 @@ static bool mutex_optimistic_spin(struct mutex *lock,
> while (true) {
> struct task_struct *owner;
>
> - if (use_ww_ctx && ww_ctx->acquired > 0) {
> + if (ww_ctx && ww_ctx->acquired > 0) {
> struct ww_mutex *ww;
>
> ww = container_of(lock, struct ww_mutex, base);


\
 
 \ /
  Last update: 2014-12-28 18:01    [W:0.115 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site