linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mutex: Remove ww_ctx unlikely() from __mutex_lock_common()
Date: Thu, 19 Jan 2017 17:42:52 +0100	[thread overview]
Message-ID: <20170119164252.GL6485@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20170119085441.09168f48@gandalf.local.home>

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) <rostedt@goodmis.org>
> ---
> 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;
>  	}
>  

  reply	other threads:[~2017-01-19 20:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18 20:58 __mutex_lock_common() unlikely very likely Steven Rostedt
2017-01-19  8:55 ` Chris Wilson
2017-01-19 13:32   ` Steven Rostedt
2017-01-19 13:54   ` [PATCH] mutex: Remove ww_ctx unlikely() from __mutex_lock_common() Steven Rostedt (VMware)
2017-01-19 16:42     ` Peter Zijlstra [this message]
2017-01-19 16:50       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170119164252.GL6485@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).