All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: __mutex_lock_common() unlikely very likely
Date: Thu, 19 Jan 2017 08:55:07 +0000	[thread overview]
Message-ID: <20170119085507.GA28607@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <20170118155824.689a9996@gandalf.local.home>

On Wed, Jan 18, 2017 at 03:58:24PM -0500, Steven Rostedt wrote:
> Chris,
> 
> My branch tracer flagged the unlikely in __mutex_lock_common() as
> always hit. That's the:
> 
> 	if (use_ww_ctx) {
> 		[...]
> 		if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
> 			return -EALREADY;
> 	}
> 
> This is hit 100% of the time, and its coming from the drm logic:

By design this is an exceptional case. In practice, drm modesetting is a
little slapsidasical when it comes to locking. However, it is the
minority use case, just that on intel, the more prevalent users do not
hit this path - though they will with the ww_mutex refactoring work. ttm
drivers (amdgpu, nouveau etc) will be demonstrating that this is the
unlikely branch.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2017-01-19  8:55 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 [this message]
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
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=20170119085507.GA28607@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.