From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768499AbcHROtZ (ORCPT ); Thu, 18 Aug 2016 10:49:25 -0400 Received: from merlin.infradead.org ([205.233.59.134]:56584 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768173AbcHROtR (ORCPT ); Thu, 18 Aug 2016 10:49:17 -0400 Date: Thu, 18 Aug 2016 16:14:04 +0200 From: Peter Zijlstra To: Jason Low Cc: Ingo Molnar , imre.deak@intel.com, linux-kernel@vger.kernel.org, Jason Low , Waiman Long , Davidlohr Bueso , Tim Chen , terry.rudd@hpe.com, "Paul E. McKenney" Subject: Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning is enabled Message-ID: <20160818141404.GA10121@twins.programming.kicks-ass.net> References: <1470854648.17361.9.camel@j-VirtualBox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470854648.17361.9.camel@j-VirtualBox> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 10, 2016 at 11:44:08AM -0700, Jason Low wrote: > diff --git a/include/linux/mutex.h b/include/linux/mutex.h > index 2cb7531..5643a233 100644 > --- a/include/linux/mutex.h > +++ b/include/linux/mutex.h > @@ -57,6 +57,8 @@ struct mutex { > #endif > #ifdef CONFIG_MUTEX_SPIN_ON_OWNER > struct optimistic_spin_queue osq; /* Spinner MCS lock */ > +#elif defined(CONFIG_SMP) > + bool yield_to_waiter; /* Prevent starvation when spinning disabled */ > #endif > #ifdef CONFIG_DEBUG_MUTEXES > void *magic; Isn't this also possible on !SMP && PREEMPT ?