From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755057AbcGVSDb (ORCPT ); Fri, 22 Jul 2016 14:03:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:43843 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754820AbcGVSDS (ORCPT ); Fri, 22 Jul 2016 14:03:18 -0400 Date: Fri, 22 Jul 2016 11:03:09 -0700 From: Davidlohr Bueso To: Waiman Long Cc: Jason Low , imre.deak@intel.com, 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: <20160722180309.GB1881@linux-80c1.suse> References: <1468858607-20481-1-git-send-email-imre.deak@intel.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <57925E25.8010506@hpe.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, 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. Thanks, Davidlohr