From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934259AbaFJA7L (ORCPT ); Mon, 9 Jun 2014 20:59:11 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.226]:47584 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932226AbaFJA7K (ORCPT ); Mon, 9 Jun 2014 20:59:10 -0400 Date: Mon, 9 Jun 2014 20:59:08 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Ingo Molnar , Lai Jiangshan , Jason Low , Brad Mouring Subject: Re: [patch V3 5/7] rtmutex: Confine deadlock logic to futex Message-ID: <20140609205908.521f7eba@gandalf.local.home> In-Reply-To: <20140609202336.338874430@linutronix.de> References: <20140609201118.387571774@linutronix.de> <20140609202336.338874430@linutronix.de> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 09 Jun 2014 20:28:09 -0000 Thomas Gleixner 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); } ?? -- Steve