Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1832731rwl; Thu, 6 Apr 2023 01:42:04 -0700 (PDT) X-Google-Smtp-Source: AKy350ZburlG15nqguBVP+nhNNbuzdDovr4OcrlqoGybsnExWJlfqIodtpZxMEosctMOPHM+Pq7R X-Received: by 2002:a17:906:350e:b0:93d:78e:d21d with SMTP id r14-20020a170906350e00b0093d078ed21dmr5357735eja.64.1680770523901; Thu, 06 Apr 2023 01:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680770523; cv=none; d=google.com; s=arc-20160816; b=etlEXSckpOHd83mRvhXSaiUuEc8gG6vf+r6q4bUofzEwKi4Zp7ZJ381KOR6qgF62qW SvyM7Pnm5kneW3Yr8k0xHrpe/e3YtUzm6fSHmRHOyJJgCWD07WPE+r37UHCaiJmaPtMh cx9rxRp7TpKBr+tsEHWVtE2FqHCE/3x08PVJo2Hkrs0KnXtc3pKJdIoS6rPokqD+asW4 rBSFpZ3M9cIGe1cIjIJC9VVWiZnACwji/8so2dqcnlntJOx1st/hhdWxaqyV6bqMtCoS Kt/xsh0d+tSwonpBL1SM0MgRbK9lzBxsdkt/Qzi+y8na/HHKSEzOBLMQOmep3y1Lfmec xZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=ucB55ZrggZmcrUK8L8pnN7CZhDIV3YVbERq4Ccf7Hjo=; b=Q3N9hcPqySv8OB199G5802uikOFK12cfpogdakmNe9MG6E5lfM2Lf2ctyM8fEMJm7g NdfswRP+SFM7JMWGgXk1Wp3CUHC6DcCrNha6l8kst2cDrvxhOoWxoo2Ky8Ydt28qZk4D 88AlUVnsOkaxoAGCjQHxTLdxEBdrf7bQ7vpkHZvVOLfWrZSGgdt193gSZGxrY3Jcvte6 LxIMZ+ekYc+iBR8dNkK0d47DDjvaBcfp3znfren2vUOYM83M4cC7oxPUvZ9wBnu7YDSl XxccJO5d7PsR6JWKXA7Jgr0lCQ9wkIXNLigUUVvnyZXOXi/sBAQqG5vz7zjpzdGWOm1n Ymew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a170906038600b00938b5232a1dsi767094eja.854.2023.04.06.01.41.37; Thu, 06 Apr 2023 01:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbjDFIic convert rfc822-to-8bit (ORCPT + 99 others); Thu, 6 Apr 2023 04:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235544AbjDFIib (ORCPT ); Thu, 6 Apr 2023 04:38:31 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BD6765A9 for ; Thu, 6 Apr 2023 01:38:28 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-125-7fp48nBONLqGXvfFx8rEDg-1; Thu, 06 Apr 2023 09:38:25 +0100 X-MC-Unique: 7fp48nBONLqGXvfFx8rEDg-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 6 Apr 2023 09:38:24 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 6 Apr 2023 09:38:24 +0100 From: David Laight To: 'Peter Zijlstra' , Wedson Almeida Filho CC: Greg KH , "rust-for-linux@vger.kernel.org" , Miguel Ojeda , "Alex Gaynor" , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn_Roy_Baron?= , "linux-kernel@vger.kernel.org" , Wedson Almeida Filho , Ingo Molnar , Will Deacon , Waiman Long Subject: RE: [PATCH v2 03/13] rust: lock: introduce `Mutex` Thread-Topic: [PATCH v2 03/13] rust: lock: introduce `Mutex` Thread-Index: AQHZaAAyCAs/X7+57kyon/cEM0LTmK8d9EKQ Date: Thu, 6 Apr 2023 08:38:24 +0000 Message-ID: References: <20230405175111.5974-1-wedsonaf@gmail.com> <20230405175111.5974-3-wedsonaf@gmail.com> <2023040554-promoter-chevron-10b2@gregkh> <2023040509-tamer-clinic-c14c@gregkh> <20230405191826.GA365912@hirez.programming.kicks-ass.net> <20230405202932.GG365912@hirez.programming.kicks-ass.net> <20230405204942.GH365912@hirez.programming.kicks-ass.net> In-Reply-To: <20230405204942.GH365912@hirez.programming.kicks-ass.net> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra > Sent: 05 April 2023 21:50 > > On Wed, Apr 05, 2023 at 05:40:39PM -0300, Wedson Almeida Filho wrote: ... > > So the situation is improved in that we don't need to manually write (and > > commit) the helpers. It may improve further in the future if we get better > > integration of the languages. > > But yeah, feel free to convert macros to inline functions where the > difference is moot. There is indeed no real reason for mutex_lock() to > not be an inline function in that case. mutex_lock() is probably ok. But there are cases where gcc generates much better code for #defines than for inline functions. Almost certainly because the front end gets to optimise #defines, but inlines are done much later on. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)