From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEBA3C433E0 for ; Wed, 17 Mar 2021 14:10:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78DF864F6A for ; Wed, 17 Mar 2021 14:10:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231184AbhCQOKZ (ORCPT ); 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