Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1051262rwl; Wed, 5 Apr 2023 11:03:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZYQUo0+FbyZkC7ZCsiCD68QCkjqTA+55XzqfD8W++u9hTPNMYAj667CsKpI1RT0Ha0wypw X-Received: by 2002:a17:90b:3807:b0:240:883:8ff8 with SMTP id mq7-20020a17090b380700b0024008838ff8mr8009961pjb.3.1680717838180; Wed, 05 Apr 2023 11:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680717838; cv=none; d=google.com; s=arc-20160816; b=Vgh/IMKtv2XhjLaAABt2V+1sWkJuMBNtKy8b+1NTFH6mmbaBZ/Nh7R+wBS6eoEWCzt 31vJmfOz54B3qX7sZUnpggup2DPNVTIQzKrtzkLELV7qwkv1FltccNOBC2Y7TcqHSCdu 6QfgnmDYcWrYORbUvHS8M2g4LjzrtDZ5+bhbV26lHCfWycd3ewda02pgMU5TGme6xU0P 1Iz1H2KWoO2KwDn+pzkf2EymD5mP3zYH9DsdsU3fEtf9d0mi2Tfc1fHgxxtTJN4gof3g uwtNMF2KZCaqVJSSrir7W73slvohu/qY0aukPNEQlgxTVmX1ll1xMEY8sH0I/d+YSWHM /fJA== 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=/LuFWU2hsaPDP8q5h0zWXx8fdLxC/3p4PEmywZ/SbT8=; b=labfUb5IIOJopC5hjrfkgsEKgSp2XW2NL4wd3YHiLhm/WbNyOYiDoVn2qVKMmrmlJ1 7wwXGfjGDeJG+3aDjz7a1rhvHGMyxEp+5Qn2qkMm1N01sGrSCkpa8AvS/LIH5uXY4+N+ 7lZzPJiVGA6ULW4wKQahOTbkQsLZPiPmIckykK570bDRJ/nkgNTKfprgrnMp6fwwf4b5 ff+wCJPR8MbXmxpnQRmhZxuW0LKyZQVrUCecnd6C5zTQoRup1FAovYWDfZ1H4dqS4jxe S+RgxsMqXVhdDvZupFPKpqHp5QBCPpzy780H/HHOTuds9yK1dC8oj3HdFF7e4cHs+9Tq eUpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ie2hpT+Q; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n10-20020a17090a670a00b0023cfb718146si1833927pjj.30.2023.04.05.11.03.35; Wed, 05 Apr 2023 11:03:58 -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=@linuxfoundation.org header.s=korg header.b=ie2hpT+Q; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230100AbjDESAV (ORCPT + 99 others); Wed, 5 Apr 2023 14:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjDESAT (ORCPT ); Wed, 5 Apr 2023 14:00:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B24F935B1; Wed, 5 Apr 2023 11:00:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 48F7863CE5; Wed, 5 Apr 2023 18:00:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B340C433D2; Wed, 5 Apr 2023 18:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680717617; bh=OTSz0e1YbSXma0rl8uSmOCO0265qUI7OXz6bhD+l8Xs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ie2hpT+QKck6Dn81IJpjOTA4b3RDVu74pXkTzJ7wrbH6zXFPSvkzqHm5pEL9H2NLu 8WfdomburLLccbFNf2kyD9kLTsDSqI+uImOvRvOafDaNC4yIef1HcsUF5FrwAs2iYR qoCG9AEaivZwowuUuuAQnkwA9LUYAwurMTYK8Kwk= Date: Wed, 5 Apr 2023 20:00:15 +0200 From: Greg KH To: Wedson Almeida Filho 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: <2023040519-crank-quarry-ef26@gregkh> References: <20230405175111.5974-1-wedsonaf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405175111.5974-1-wedsonaf@gmail.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 02:50:59PM -0300, Wedson Almeida Filho wrote: > From: Wedson Almeida Filho > > It is a wrapper around C's `lock_class_key`, which is used by the > synchronisation primitives that are checked with lockdep. This is in > preparation for introducing Rust abstractions for these primitives. > > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Will Deacon > Cc: Waiman Long > Co-developed-by: Boqun Feng > Signed-off-by: Boqun Feng > Signed-off-by: Wedson Almeida Filho > --- > v1 -> v2: Fixed a typo in comment > > rust/kernel/sync.rs | 45 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > > diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs > index 33da23e3076d..84a4b560828c 100644 > --- a/rust/kernel/sync.rs > +++ b/rust/kernel/sync.rs > @@ -5,6 +5,51 @@ > //! This module contains the kernel APIs related to synchronisation that have been ported or > //! wrapped for usage by Rust code in the kernel. > > +use crate::types::Opaque; > + > mod arc; > > pub use arc::{Arc, ArcBorrow, UniqueArc}; > + > +/// 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. thanks, greg k-h