From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbdASU52 (ORCPT ); Thu, 19 Jan 2017 15:57:28 -0500 Received: from merlin.infradead.org ([205.233.59.134]:32774 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144AbdASU51 (ORCPT ); Thu, 19 Jan 2017 15:57:27 -0500 Date: Thu, 19 Jan 2017 17:42:52 +0100 From: Peter Zijlstra To: "Steven Rostedt (VMware)" Cc: LKML , Chris Wilson , Ingo Molnar , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH] mutex: Remove ww_ctx unlikely() from __mutex_lock_common() Message-ID: <20170119164252.GL6485@twins.programming.kicks-ass.net> References: <20170118155824.689a9996@gandalf.local.home> <20170119085507.GA28607@nuc-i3427.alporthouse.com> <20170119085441.09168f48@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170119085441.09168f48@gandalf.local.home> 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 Thu, Jan 19, 2017 at 08:54:41AM -0500, Steven Rostedt (VMware) wrote: > I added a comment stating that the branch should be unlikely, but due > to the intel drm logic, it currently isn't. Then if drm changes in the > future, we could then try it again. I really don't see the point here. The unlikely() also conveys this is not a fast path branch and that is still true, regardsless of what runtime does. Also, the patch wouldn't apply even if I were so inclined. > Signed-off-by: Steven Rostedt (VMware) > --- > diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c > index a70b90d..577bb74 100644 > --- a/kernel/locking/mutex.c > +++ b/kernel/locking/mutex.c > @@ -513,7 +513,11 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, > > if (use_ww_ctx) { > struct ww_mutex *ww = container_of(lock, struct ww_mutex, base); > - if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) > + /* > + * This really should be an unlikely() but currently > + * the intel drm makes this a very likely case. > + */ > + if (ww_ctx == READ_ONCE(ww->ctx)) > return -EALREADY; > } >