Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1186974rwl; Wed, 5 Apr 2023 13:06:29 -0700 (PDT) X-Google-Smtp-Source: AKy350Yok/qlqjc2divUYkZt3DKMYfxc8EgdkE68ozo7FrT18pkPLlTsSXkYNFUQMOHfV3bUEqNV X-Received: by 2002:a17:906:468d:b0:8f3:dc49:d8eb with SMTP id a13-20020a170906468d00b008f3dc49d8ebmr3846446ejr.71.1680725189495; Wed, 05 Apr 2023 13:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680725189; cv=none; d=google.com; s=arc-20160816; b=cx7hnu1NLUbe4tj8qR5tNm/Z4tHqVj4IIk+bRpG1X8kMxMyFgglQJOL8Co46ud8bRX UIycQc1/ysYuh8Dac8FqW3Lm+xT8xoDeVENcT91lX7aaALDHVN0UoJo5+ReHE04D5MHi za775pOdZ2KG8h07yu//gFqS6pOCeZC2B+wr4jUKvHQE9reXuGuV8WW3mrG6BY1Sa947 zkEdSDS9M3GkCgNdu+PGhqUUQxgUplV5TS0gjlIEQguCrprPh7ZPdQuRA81piZ36/r32 bhYZFOAjY59JT7bMiGULVQFmBkGvnzFv+Cqmgbr2NGtQ1+FSUmNqaJ3anRcsXbfy1yoj TMLQ== 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=jnLNhgHegwlksR6QMEavxXDZkqPjONybl034vvnWzPc=; b=zkn+0fERMalBU7RLV+OqKXHbN5cmDmM8GQpM4aLIsGtmsI+98p+w4phVi5m0EAcCTc npMOkzei8MmWrLz+cDb9qwz/60sGkOBlhVjCRJKUOpz7sA8LaFhgnRBpFpJc7iDXIAOH 1xNRrolPq8yCI05p2SdPNa9/wRCAGBpDm+uNlMp1DrQqDnFFsf2pUwYXj0mDZdsa1QST PzaX24wfpPIa6kVRk0UNYy3AT5XyDN5f/XD3FS2bYjoJ0XumByMpZIIvi3Bg9qyj5tIq Wosgft9q5yN4MaKa1be+WrDr9Ntj1ywxSSlkvW/cJ7rqipCxYRuPZvdEybx4mnftc5ta zXWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HiJ0NJor; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020a170906380900b009332ffa5891si9403840ejc.136.2023.04.05.13.06.03; Wed, 05 Apr 2023 13:06:29 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HiJ0NJor; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232605AbjDEUFW (ORCPT + 99 others); Wed, 5 Apr 2023 16:05:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjDEUFV (ORCPT ); Wed, 5 Apr 2023 16:05:21 -0400 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D463A268B; Wed, 5 Apr 2023 13:05:18 -0700 (PDT) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-177ca271cb8so39867443fac.2; Wed, 05 Apr 2023 13:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680725118; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jnLNhgHegwlksR6QMEavxXDZkqPjONybl034vvnWzPc=; b=HiJ0NJorOc4gkxW3fGbhTxLMvU+aZPzT/MPyGFj8wPOuLsCcO/9SqqBSgfVMqvBqB2 a6+pATtsjGGPFiisH3Kk9gLMY11+HzvIBawLyza0rzsXlmh+egc7xkA1XupIddGceoD5 91dUBp7cuS0XdyhgoOg8lhdvG+DdX9qT7ItPmYJ23vcTW6szhaFNe2R+guxavLVmVXot AQv+7teZ9irvTFCLgYp0lbKIRp3OtElcVEZQDTXd0a58aqxbDZKBXZBx1lS3UIjy9Lln k5GNslobz/FoshP2bnfdtdvAjNC06L91cOWAN4eC4aHbpX6lb2xNTK9qX6Bt/ZLM0rw1 gDAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680725118; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jnLNhgHegwlksR6QMEavxXDZkqPjONybl034vvnWzPc=; b=NGOSpe94G/PdasXaMDUbVAPkqNGl5edzfWZf/0+murT1jpipFTWPQT3LhERXXFsWrY VcpnZYc7cqm6tMILUrWS3ftisN7uPvzz2yECI+s+Bub+TZwlJYp4JzOLOG1rc9aI/rHW xeQRZAwn4u9so5gx9ieQtBkHc2QVIc/1ZXqaVt0CWS4vGilp9E4ZBjwSQev3AcxNvbQt 04Rh8re/d//htqbqEv7rFkeL9wCCMzmQoUrmflRJZDyBwP54zO8eYg+oq9YF5RUHmWZO xPii0Nry+kdfi8SyVwlMIElKOh2XsloJUcQ+p7890oLRStp5sDRcN72QMWiDpcYOUGzI LLDQ== X-Gm-Message-State: AAQBX9fyKuAN9dt9YHQMFYRNOM3buo1DY2XhcDOhCdCRIrJPcpEYAEGk 8pTiygJuSSGTH1vr+P3eVX0= X-Received: by 2002:a05:6870:832a:b0:180:7b07:2845 with SMTP id p42-20020a056870832a00b001807b072845mr4111048oae.47.1680725118085; Wed, 05 Apr 2023 13:05:18 -0700 (PDT) Received: from wedsonaf-dev ([189.124.190.154]) by smtp.gmail.com with ESMTPSA id i18-20020a056830011200b006a0ae1c4263sm7339186otp.48.2023.04.05.13.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 13:05:17 -0700 (PDT) Date: Wed, 5 Apr 2023 17:05:10 -0300 From: Wedson Almeida Filho To: Greg KH Cc: 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 , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long Subject: Re: [PATCH v2 01/13] rust: sync: introduce `LockClassKey` Message-ID: References: <20230405175111.5974-1-wedsonaf@gmail.com> <2023040519-crank-quarry-ef26@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023040519-crank-quarry-ef26@gregkh> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 On Wed, Apr 05, 2023 at 08:00:15PM +0200, Greg KH wrote: > On Wed, Apr 05, 2023 at 02:50:59PM -0300, Wedson Almeida Filho wrote: > > From: Wedson Almeida Filho > > > > +/// Represents a lockdep class. It's a wrapper around C's `lock_class_key`. > > +#[repr(transparent)] > > +pub struct LockClassKey(Opaque); > > Will this disappear into "nothing" if lockdep is disabled in the build? > > If not, it should, if so, I couldn't see where that option was, sorry > for the noise. Yeah, the C definition of lock_class_key is an empty struct, which is a zero-sized type. So instances of this type will occupy 0 bytes. We'll still have the cost of passing pointers from Rust to C of instances of this type, which we could add an alternate version (dependent on lockdep being enabled or not) in Rust to avoid, but since it will be optimised away when LTO is enabled and doesn't add up to much when LTO is disabled, we chose the simpler option of having a single implementation.