Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp550252pxf; Wed, 17 Mar 2021 10:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz26022QFjiEGGTKMWGvtzx2fEiAMKUVElBE/6BndqVCegozmIE915xQfWo1qNoM+OWC2Cc X-Received: by 2002:aa7:d44a:: with SMTP id q10mr42647757edr.278.1616001396764; Wed, 17 Mar 2021 10:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616001396; cv=none; d=google.com; s=arc-20160816; b=Qs25w0S8QTxw5CV39I58KS58WoANdWReSE3tIpOZOa3o2jbKV8HElm8Llo8lv997R8 wCwS4EdWheG9N7HoYT+7Fv7Ltbv6j7Xj/HPIWPWGkselIg28tOC9pKHG/N3LBMLrr7xN sDAZyifUP0+pt3e5g22Pt2Vp7Z4w9agUYcWC5bCyp/rc4+9rCta1WrCz7zMNj1hA6SK1 ZMLaXH/8Veg5EVpuQLwDTjq7h3rnRJQthTZqNEPrxLON8f48sFy1UGOmnoro+1iaSDsI kJFH0C2FWIInRRptqedhSry2IneNgKhzfEBBeE8Yyr6mSNCWC2LWssdvQNSE5WDFKy5T aVqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ySJwnXmmut2FRkHGqONP6uMpr1gdDk9gWPXbqHdMFeU=; b=Oq/DsYC+gPiMFPOr4fFvudhKEprRPFUDmkfytllQeuEhqZitpNQhCFfIeCaPvJxSMx dDckIFe6NIbxT8fJvwOmKzF4q11aRWSXbG1Vr7avK8ODZiZ0O42cwMrHey6ycPgnJzRf u10Qd7Ih7XTT+ZWId70QYK9G+Zv1q/ayrd80gQorPW7qNM46uETJigxgrWOn+TkQShgt x3AGYM7akIyMl6za6+3x5nMnsEDkDxhqU8JAOI1TJp0k6xt9eo8ZB8h4hebNDwAbPBjn Xae++Sdv9zwLI1FCea3xxF1xOSNYK8C1huWBUFl0Xds9DFf5znO/VAcCgsxTXotcR/Q5 HZdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=D1eg6Xki; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si16750819ede.364.2021.03.17.10.16.13; Wed, 17 Mar 2021 10:16:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=D1eg6Xki; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230489AbhCQORW (ORCPT + 99 others); Wed, 17 Mar 2021 10:17:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbhCQORM (ORCPT ); Wed, 17 Mar 2021 10:17:12 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CE34C06174A; Wed, 17 Mar 2021 07:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ySJwnXmmut2FRkHGqONP6uMpr1gdDk9gWPXbqHdMFeU=; b=D1eg6Xkib9+0luGkFQ1ugveZHi V2Qf5V4mqRzFbPfGpGS3ZidSxjMdx8OjvGUydu5qiQO8fnkd1HqGHvRrdspQn1Dh4DbWmdw6cqvP2 O9mp4l5rASAfA8WUrxNgmPt6pnELvPvSN7iSRDJntAmDAUcPXzFPC4jf3y1Nonw7FKJx7kkpTubDg 4qpu5vEKZ17hidVmN1eeZeUQ84FtPd9kCPVK0v3EBJDcdluqekdXAZv/bQOPeVsrZbIwsTg+5QJns ZSYZJzg/FSA9LZGH0v2q7kWA4MC7W5zL7cJ36NYia+3j8Et2SkYj2OPmkUU94V6LtjtCDKetCJLo1 cRiOJzDw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lMWyx-003EiT-Pz; Wed, 17 Mar 2021 14:17:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E87103050F0; Wed, 17 Mar 2021 15:17:06 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D05B42078107C; Wed, 17 Mar 2021 15:17:06 +0100 (CET) Date: Wed, 17 Mar 2021 15:17:06 +0100 From: Peter Zijlstra To: Waiman Long Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Ingo Molnar , Davidlohr Bueso , x86@kernel.org Subject: Re: [tip: locking/urgent] locking/ww_mutex: Simplify use_ww_ctx & ww_ctx handling Message-ID: References: <20210316153119.13802-2-longman@redhat.com> <161598470257.398.5006518584847290113.tip-bot2@tip-bot2> <85fbce04-c544-6041-6e7d-76f47b90e263@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 10:10:16AM -0400, Waiman Long wrote: > On 3/17/21 9:55 AM, Peter Zijlstra wrote: > > On Wed, Mar 17, 2021 at 09:43:20AM -0400, Waiman Long wrote: > > > > > Using gcc 8.4.1, the generated __mutex_lock function has the same size (with > > > last instruction at offset +5179) with or without this patch. Well, you can > > > say that this patch is an no-op wrt generated code. > > OK, then GCC has gotten better. Because back then I tried really hard > > but it wouldn't remove the if (ww_ctx) branches unless I had that extra > > const bool argument. > > > I think ww_mutex was merged in 2013. That is almost 8 years ago. It could > still be the case that older gcc compilers may not generate the right code. > I will try the RHEL7 gcc compiler (4.8.5) to see how it fares. I really don't care about code generation qualitee of anything before 8-ish at this point. That's already an old compiler. If you run on ancient compilers, you simply don't care about code quality.