From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbdASIz5 (ORCPT ); Thu, 19 Jan 2017 03:55:57 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:60837 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751080AbdASIz4 (ORCPT ); Thu, 19 Jan 2017 03:55:56 -0500 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Thu, 19 Jan 2017 08:55:07 +0000 From: Chris Wilson To: Steven Rostedt Cc: LKML , Peter Zijlstra Subject: Re: __mutex_lock_common() unlikely very likely Message-ID: <20170119085507.GA28607@nuc-i3427.alporthouse.com> References: <20170118155824.689a9996@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170118155824.689a9996@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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