Re: [patch 4/6] rtmutex: Confine deadlock logic to futex

2014-05-22 Thread Peter Zijlstra
On Thu, May 22, 2014 at 03:25:50AM -, Thomas Gleixner wrote:
> The builtin tester is gone,, so the deadlock logic is now only
> required for futexes.
> 
> Remove the extra arguments for the public functions and also for the
> futex specific ones which get always called with deadlock detection
> enabled.

This reminds me, the raw rt_mutex primitives have no lockdep support,
and we've grown a few users in-tree. We should fix that.


pgpv8dHyNpNga.pgp
Description: PGP signature


Re: [patch 4/6] rtmutex: Confine deadlock logic to futex

2014-05-28 Thread Thomas Gleixner
On Thu, 22 May 2014, Peter Zijlstra wrote:
> On Thu, May 22, 2014 at 03:25:50AM -, Thomas Gleixner wrote:
> > The builtin tester is gone,, so the deadlock logic is now only
> > required for futexes.
> > 
> > Remove the extra arguments for the public functions and also for the
> > futex specific ones which get always called with deadlock detection
> > enabled.
> 
> This reminds me, the raw rt_mutex primitives have no lockdep support,
> and we've grown a few users in-tree. We should fix that.

It shouldn't be that hard. We just need to exclude the futex mess ...

Thanks,

tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 4/6] rtmutex: Confine deadlock logic to futex

2014-05-30 Thread Steven Rostedt
On Thu, 22 May 2014 03:25:50 -
Thomas Gleixner  wrote:

> Index: tip/kernel/locking/rtmutex.c
> ===
> --- tip.orig/kernel/locking/rtmutex.c
> +++ tip/kernel/locking/rtmutex.c
> @@ -957,47 +957,53 @@ EXPORT_SYMBOL_GPL(rt_mutex_lock);
>  /**
>   * rt_mutex_lock_interruptible - lock a rt_mutex interruptible
>   *
> - * @lock:the rt_mutex to be locked
> - * @detect_deadlock: deadlock detection on/off
> + * @lock:the rt_mutex to be locked
>   *
>   * Returns:
> - *  0on success
> - * -EINTRwhen interrupted by a signal
> - * -EDEADLK  when the lock would deadlock (when deadlock detection is on)
> + *  0on success
> + * -EINTRwhen interrupted by a signal
>   */
> -int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock,
> -  int detect_deadlock)
> +int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock)
>  {
>   might_sleep();
>  
>   return rt_mutex_fastlock(lock, TASK_INTERRUPTIBLE,
> -  detect_deadlock, rt_mutex_slowlock);
> +  RT_MUTEX_MIN_CHAINWALK, rt_mutex_slowlock);


I noticed after this change, the only two callers of rt_mutex_fastlock()
only pass in RT_MUTEX_MIN_CHAINWALK. We could remove the passing of
detect_deadlock to that too, and simplify that function.

-- Steve


>  }
>  EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible);
>  
> +/*
> + * Futex variant to allow full deadlock detection.
> + */
> +int __rt_mutex_timed_lock(struct rt_mutex *lock,
> +   struct hrtimer_sleeper *timeout)
> +{
> + might_sleep();
> +
> + return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout,
> +RT_MUTEX_FULL_CHAINWALK,
> +rt_mutex_slowlock);
> +}
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/