From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754371AbcGVT0S (ORCPT ); Fri, 22 Jul 2016 15:26:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:48061 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753829AbcGVT0Q convert rfc822-to-8bit (ORCPT ); Fri, 22 Jul 2016 15:26:16 -0400 Date: Fri, 22 Jul 2016 12:26:06 -0700 From: Davidlohr Bueso To: Imre Deak Cc: Waiman Long , Jason Low , Peter Zijlstra , linux-kernel@vger.kernel.org, Ingo Molnar , Chris Wilson , Daniel Vetter Subject: Re: [RFC] Avoid mutex starvation when optimistic spinning is disabled Message-ID: <20160722192606.GC1881@linux-80c1.suse> References: <20160718171537.GC6862@twins.programming.kicks-ass.net> <1468864069.2367.21.camel@j-VirtualBox> <1468947205.31332.40.camel@intel.com> <1468969470.10247.15.camel@j-VirtualBox> <1468989556.10247.22.camel@j-VirtualBox> <1469021399.19093.14.camel@intel.com> <1469134658.2344.12.camel@j-VirtualBox> <57925E25.8010506@hpe.com> <20160722180309.GB1881@linux-80c1.suse> <1469212184.9353.15.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <1469212184.9353.15.camel@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jul 2016, Imre Deak wrote: >On Fri, 2016-07-22 at 11:03 -0700, Davidlohr Bueso wrote: >> On Fri, 22 Jul 2016, Waiman Long wrote: >> >> > I think making mutex_trylock() fail maybe a bit too far. Do we >> > really >> > have any real workload that cause starvation problem  because of >> > that. >> > Code that does mutex_trylock() in a loop can certainly cause lock >> > starvation, but it is not how mutex_trylock() is supposed to be >> > used. >> > We can't build in safeguard for all the possible abuses of the >> > mutex >> > APIs. >> >> True, and that's actually why I think that 'fixing' the >> !SPIN_ON_OWNER case >> is a bit too far in the first place: most of the archs that will care >> about >> this already have ARCH_SUPPORTS_ATOMIC_RMW. The extra code for >> dealing with >> this is not worth it imo. > >SPIN_ON_OWNER is also disabled in case of DEBUG_MUTEXES, which is the >config where I wanted to avoid starvation in the first place. Well yes, but know of course that that option is even less common than archs with non atomic Rmw. Thanks, Davidlohr