From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: Re: [RFC][PATCH RT 0/3] RT: Fix trylock deadlock without msleep() hack Date: Sat, 5 Sep 2015 08:26:26 -0400 Message-ID: <20150905082626.00a20902@gandalf.local.home> References: <20150904011900.730816481@goodmis.org> <20150905120457.GA21338@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, linux-rt-users , Carsten Emde , Sebastian Andrzej Siewior , John Kacur , Paul Gortmaker , Peter Zijlstra , Clark Williams , Arnaldo Carvalho de Melo To: Ingo Molnar Return-path: Received: from smtprelay0115.hostedemail.com ([216.40.44.115]:41608 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751442AbbIEM03 (ORCPT ); Sat, 5 Sep 2015 08:26:29 -0400 In-Reply-To: <20150905120457.GA21338@gmail.com> Sender: linux-rt-users-owner@vger.kernel.org List-ID: On Sat, 5 Sep 2015 14:04:57 +0200 Ingo Molnar wrote: > So why not do: > > lock(B); > if (!trylock(A)) { > unlock(B); > lock(A); > lock(B); > } > > ? > > Or, if this can be done, why didn't we do: > > lock(A); > lock(B); > > to begin with? > > i.e. I'm not sure the problem is properly specified. Yeah, this is actually the solution I came up with before. I misread what Thomas wrote. His is slightly different. -- Steve