lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170119083252.6cbb0c8d@gandalf.local.home>
Date:   Thu, 19 Jan 2017 08:32:52 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Chris Wilson <chris@...is-wilson.co.uk>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: __mutex_lock_common() unlikely very likely

On Thu, 19 Jan 2017 08:55:07 +0000
Chris Wilson <chris@...is-wilson.co.uk> wrote:

> 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.
>

Then I suggest that we remove the unlikely, as it's only "unlikely" if
you have the right hardware. If you don't (and I appear to have three
boxes that don't) then it becomes very likely.

"unlikely" is not about how likely you have the right hardware. It's
about high likely the logic is. If it's a hardware issue, it shouldn't
have a likely or unlikely attached to it.

I'll send a patch to nuke it. When drm is no longer a special case,
because it's a popular platform, we can add it back.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ