[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1406101939100.5170@nanos>
Date: Tue, 10 Jun 2014 19:39:39 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Steven Rostedt <rostedt@...dmis.org>
cc: LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Lai Jiangshan <laijs@...fujitsu.com>,
Jason Low <jason.low2@...com>, Brad Mouring <bmouring@...com>
Subject: Re: [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@...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);
> > +}
> > +
> > /**
> > * 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
--
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