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]
Message-ID: <539683A6.7040707@cn.fujitsu.com>
Date:	Tue, 10 Jun 2014 12:03:50 +0800
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>, Jason Low <jason.low2@...com>,
	Brad Mouring <bmouring@...com>
Subject: Re: [patch V3 5/7] rtmutex: Confine deadlock logic to futex

On 06/10/2014 08:59 AM, Steven Rostedt wrote:
> On Mon, 09 Jun 2014 20:28:09 -0000
> Thomas Gleixner <tglx@...utronix.de> wrote:
>   
>> +/*
>> + * 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, 0,
>> +				       rt_mutex_slowlock);
>> +}

This futex variant one is not used until next patch, it should not be
introduced in this patch.

>> +
>>  /**
>>   * rt_mutex_timed_lock - lock a rt_mutex interruptible
>>   *			the timeout structure is provided
>>   *			by the caller
>>   *
>> - * @lock: 		the rt_mutex to be locked
>> + * @lock:		the rt_mutex to be locked
>>   * @timeout:		timeout structure or NULL (no timeout)
>> - * @detect_deadlock:	deadlock detection on/off
>>   *
>>   * Returns:
>> - *  0 		on success
>> - * -EINTR 	when interrupted by a signal
>> + *  0		on success
>> + * -EINTR	when interrupted by a signal
>>   * -ETIMEDOUT	when the timeout expired
>> - * -EDEADLK	when the lock would deadlock (when deadlock detection is on)
>>   */
>>  int
>> -rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout,
>> -		    int detect_deadlock)
>> +rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout)
>>  {
>>  	might_sleep();
>>  
>> -	return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout,
>> -				       detect_deadlock, rt_mutex_slowlock);
>> +	return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, 0,
>> +				       rt_mutex_slowlock);
>>  }
>>  EXPORT_SYMBOL_GPL(rt_mutex_timed_lock);
>>  
> 
> I must be missing something. What's the difference between the above
> and the futex variant one? They both do the exact same thing:
> 

It will use RT_MUTEX_*FULL*_CHAINWALK for the futex variant one while
rt_mutex_timed_lock() will use RT_MUTEX_*MIN*_CHAINWALK

> 
> int foo(struct rt_mutex *lock, struct hrtimer_sleeper *timeout)
> {
> 	might_sleep();
> 
> 	return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timout,
> 				       0, rt_mutex_slowlock);
> }
> 
> 
> ??
> 
> -- Steve
> .
> 

--
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