lkml.org 
[lkml]   [2014]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V3 5/7] rtmutex: Confine deadlock logic to futex
On Mon, 9 Jun 2014, Steven Rostedt wrote:
> On Mon, 09 Jun 2014 20:28:09 -0000
> Thomas Gleixner <tglx@linutronix.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);
> > +}
> > +
> > /**
> > * 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:
>
>
> 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);
> }

Right. The one for futex must have s/0/1/. Fixed.

Thanks,

tglx


\
 
 \ /
  Last update: 2014-06-10 20:21    [W:0.099 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site