Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp549919pxf; Wed, 17 Mar 2021 10:16:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYjbJE911dJa95Z2p9c4BNdkE6ZSftKgXn27v0Slxrq6HzE4QRmUxLSvz6aRPkIWqceELx X-Received: by 2002:aa7:ca04:: with SMTP id y4mr43004857eds.339.1616001371012; Wed, 17 Mar 2021 10:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616001371; cv=none; d=google.com; s=arc-20160816; b=oCqneLgmI+O4fN8gWo9xGfwHBBvLttsZ63YOPNqgfAgaDf/fvFi85INYtjKQfm/W8k EQks1GVpXaqkeHQUfPs5caXtH8+bj5QoViM7SKXytWbhygVIHXw+Dylv2IwB//B1jjA1 E+n9XD3rTfN9+96FeqM8/XWu49FBBCArvosSOu9jWWIbK5LRVSEMSBShrTJa8Ovrn+yY EQobJHw8B/5GfPsRmSUWvGgfTDu5cYRfvbnksJStwURLNJwziUnJiy3u7eT84bs9tNMA 0pk8KW+6lgJ9xha5dJdVuj6oCHVL+AhP23MLoaEVQz8/Ks+Wuf0NbvD/TNGbV9FJiIk2 q4nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=65P6PL5OL/2717NBzXNqPQ+q5PP+bR0voBu5yKlNlo8=; b=evF5AdZMllsu6T6JGs7RW6itMYJswl+r7KSpCjv04gizJc2bZMhOS5nnFEAQw0L2qt bF2pQ22Tsr6hUBUtosZs+hAhehTZoSqmnA9R7nvf7dJC1QK6g9Etu+R2+0jXgm3qew2r 0Cw+s1vdF+sZnlVl7p5TgFGbAd9JzcnmEVjSPPvlpQZwM0Rt56Q5y1o1O+S3w+H/t8Zz NBk1Mk/OiLu/B1+jc4ACgFNdzfubh8jp6uffCtcS2iEs0ol4YJqNV/f8RRTZH6c2HE5s JbnPIbzo2Z/0Kci7ldwBBFa/m3RQa6StwSF9ZZUywHhgiqPt+e47emlyTj8yNHxRZypf bkeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K1qmvEhB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si16441948ejy.571.2021.03.17.10.15.47; Wed, 17 Mar 2021 10:16:10 -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=@redhat.com header.s=mimecast20190719 header.b=K1qmvEhB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhCQOKZ (ORCPT + 99 others); Wed, 17 Mar 2021 10:10:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37411 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231211AbhCQOKV (ORCPT ); Wed, 17 Mar 2021 10:10:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615990220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=65P6PL5OL/2717NBzXNqPQ+q5PP+bR0voBu5yKlNlo8=; b=K1qmvEhBz7rIT+4lQYGPYQxAzPDu8T1vBEYhZ6CG6k9/MxajeuH6upiBOBPTBcPpLehCII GrWJkk9r43QVQab7fR1KkEISGQlrVihyDxRJyfMBXSQUKGgeCLUmE6h/9G7/1Btb+0y6yx VQOhUoU/y87N6sGb+8WhqjMBeFyzcuE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-BWa9y-b_NPC7rsWPf4OW1Q-1; Wed, 17 Mar 2021 10:10:18 -0400 X-MC-Unique: BWa9y-b_NPC7rsWPf4OW1Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9016AEC1A1; Wed, 17 Mar 2021 14:10:17 +0000 (UTC) Received: from llong.remote.csb (ovpn-117-171.rdu2.redhat.com [10.10.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5DE650DDB; Wed, 17 Mar 2021 14:10:16 +0000 (UTC) Subject: Re: [tip: locking/urgent] locking/ww_mutex: Simplify use_ww_ctx & ww_ctx handling To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Ingo Molnar , Davidlohr Bueso , x86@kernel.org References: <20210316153119.13802-2-longman@redhat.com> <161598470257.398.5006518584847290113.tip-bot2@tip-bot2> <85fbce04-c544-6041-6e7d-76f47b90e263@redhat.com> From: Waiman Long Organization: Red Hat Message-ID: Date: Wed, 17 Mar 2021 10:10:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cheers, Longman