lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 30 May 2014 22:06:52 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Lai Jiangshan <laijs@...fujitsu.com>
Subject: Re: [patch 4/6] rtmutex: Confine deadlock logic to futex

On Thu, 22 May 2014 03:25:50 -0000
Thomas Gleixner <tglx@...utronix.de> 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:
> - *  0 		on success
> - * -EINTR 	when interrupted by a signal
> - * -EDEADLK	when the lock would deadlock (when deadlock detection is on)
> + *  0		on success
> + * -EINTR	when 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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ