From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753528AbcEZKnf (ORCPT ); Thu, 26 May 2016 06:43:35 -0400 Received: from mail.fireflyinternet.com ([87.106.93.118]:63477 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753154AbcEZKne (ORCPT ); Thu, 26 May 2016 06:43:34 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Thu, 26 May 2016 11:43:29 +0100 From: Chris Wilson To: Maarten Lankhorst Cc: Peter Zijlstra , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian =?iso-8859-1?Q?K=F6nig?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mutex: Do not spin/queue before performing ww_mutex deadlock avoidance Message-ID: <20160526104329.GS15901@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Maarten Lankhorst , Peter Zijlstra , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian =?iso-8859-1?Q?K=F6nig?= , linux-kernel@vger.kernel.org References: <1464251487-23778-1-git-send-email-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, May 26, 2016 at 12:37:30PM +0200, Maarten Lankhorst wrote: > The check should also not be for NULL, but for use_ww_ctx. > This way the if check is optimized out for the ww_ctx path, where > ww_ctx is always non-null. The compiler can see use_ww_ctx == false => ww_ctx == NULL just as well to do dead-code elimination, i.e. use_ww_ctx is superflouus and does not reduce the code size. (gcc 4.7.2, 4.9.1, 5.3.1) -Chris -- Chris Wilson, Intel Open Source Technology Centre