Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753620AbcLFSrk (ORCPT ); Tue, 6 Dec 2016 13:47:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45878 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbcLFSri (ORCPT ); Tue, 6 Dec 2016 13:47:38 -0500 Subject: Re: [PATCH v2 02/11] locking/ww_mutex: Re-check ww->ctx in the inner optimistic spin loop To: Peter Zijlstra References: <1480601214-26583-1-git-send-email-nhaehnle@gmail.com> <1480601214-26583-3-git-send-email-nhaehnle@gmail.com> <20161206150620.GT3045@worktop.programming.kicks-ass.net> <20161206182935.GD3107@twins.programming.kicks-ass.net> Cc: =?UTF-8?Q?Nicolai_H=c3=a4hnle?= , linux-kernel@vger.kernel.org, =?UTF-8?Q?Nicolai_H=c3=a4hnle?= , Ingo Molnar , Maarten Lankhorst , Daniel Vetter , Chris Wilson , dri-devel@lists.freedesktop.org From: Waiman Long Organization: Red Hat Message-ID: <4505b2ea-3d15-ca62-2fab-38d697d80ee5@redhat.com> Date: Tue, 6 Dec 2016 13:46:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161206182935.GD3107@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 06 Dec 2016 18:46:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 786 Lines: 17 On 12/06/2016 01:29 PM, Peter Zijlstra wrote: > On Tue, Dec 06, 2016 at 11:03:28AM -0500, Waiman Long wrote: >> The mutex_spin_on_owner() function was originally marked noinline >> because it could be a major consumer of CPU cycles in a contended lock. >> Having it shown separately in the perf output will help the users have a >> better understanding of what is consuming all the CPU cycles. So I would >> still like to keep it this way. > ah!, I tried to dig through history but couldn't find a reason for it. > >> If you have concern about additional latency for non-ww_mutex calls, one >> alternative can be: > That's pretty horrific :/ I am not totally against making mutex_spin_on_owner() an inline function. If you think it is the right way to go, I am OK with that. -Longman