Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp45578rwl; Thu, 30 Mar 2023 11:56:21 -0700 (PDT) X-Google-Smtp-Source: AKy350ZV+eiE9H3UP8p1xNbQbqJ+Kpivw6i2OBpmf0yB8GpTUibtfmrjCim5eAm5MPVb+bN9ROZw X-Received: by 2002:a05:6a20:748c:b0:cd:fc47:dd74 with SMTP id p12-20020a056a20748c00b000cdfc47dd74mr3472159pzd.4.1680202580838; Thu, 30 Mar 2023 11:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680202580; cv=none; d=google.com; s=arc-20160816; b=v2PZCS89THrtc6Qe8klPQDbYgMQoWZ0+zWtD9Y04eQRLY8xYrSlNBgcY4xMs4xjTfF qRNl6LN6h77fG9xbzfu0a7SCYC6fVFLYvfYBlBQJPDP0LDQCYrdiu9vCQvEGaGT60q8V X6TPskDhwTCaQtdlWQYG7deyk1pqMojMGTmhaIzdx0AeHTlUM1/tOSlcwb9U0BjVxNf1 2nTW0yJuy3g5M7eJD3goa0lhhrN5pY3CDfBlHD7UHY+txS/dm9bH7KHcNGybaChhKJXo JYngC9Il5NGJkKkuj0IxXL6ZqdVPD/D1g+C1pCsIAZc3weaH5nO8Dd6Dsolmhp45nHMP BBcw== 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:feedback-id :dkim-signature; bh=QvdpDaUCX6HrbPh4opBGTooMsJIvWBbLgc7Xy6twBlk=; b=zQgXdRnb3dvVDUQjIGz8w0EkzQveKxxkg/0gMbUwXIBOraLFu//gr2ZlAlx3FDVhcu 4GVCyOBVQU2i3r3ur/RlTNT8Kr5AzE83dr0kSmwMuZrmKySs5hGvKLms96favp6y33TB UPLNSWkhRooVceCXEviUqpMBGTAiGuslU2mpJQa2sDv7sT0Lag9NK2Itqidqm5sPsR8B oq67DmYRYp+zF3UNrok9F+irsMhGQaNqSGMmnYBI0ZMdF4NZ/N88L7Cs28RHy/sJsbd7 JzGFo5+yiqGY36wTpWsE10Ykb5syXBC1Mwyxc+cMwuG/ZnowksuYmGuM4mQMGQ9eS3bI 6Zjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FhRla7cG; 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 p18-20020a634f52000000b00508bff55298si282344pgl.583.2023.03.30.11.56.08; Thu, 30 Mar 2023 11:56:20 -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=FhRla7cG; 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 S231578AbjC3SsB (ORCPT + 99 others); Thu, 30 Mar 2023 14:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbjC3SsA (ORCPT ); Thu, 30 Mar 2023 14:48:00 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C119BB98; Thu, 30 Mar 2023 11:47:59 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id h16so12657378qtn.7; Thu, 30 Mar 2023 11:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680202078; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=QvdpDaUCX6HrbPh4opBGTooMsJIvWBbLgc7Xy6twBlk=; b=FhRla7cGwH9sWjbWyjL6OU0CcYD1tOT2N+dqdJq0ul9s1kkgJaVgeMFTrj6NJM9RMG 0S8R/IKr3rkT2m/MZSUWa/ZVObCW1KXGx+YoBWX34oIZ7pktBy+MUcyJ4+doEvwPcTPt bzemRLPxeTw819NhO+bwdQcmLloT1dIIvntQxIco85Qh53qY6oBThQWu7fEdm2YWWOTW Z+HQxAYk1gc/9JObvwIoH5EqX+NX0TjIXtlo5Fri9yWI3pdHRTzZua8qm2StdtXmgb6n rpaSxoB0Y5B2c2GJMPVYutQGClWX/7+E59MxRKvdpuVsDzNiRe+CyUpodILmyUk1bARa B4vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680202078; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QvdpDaUCX6HrbPh4opBGTooMsJIvWBbLgc7Xy6twBlk=; b=AOazmfpMNXRU8VOeT7WiAN2wJd+ffbSmJYB3m42neTNNSPJTeiCZw+43o4Xh7I5XPk A3xTw1/+jeAX2NuvIrtLcTQDIBpSI5ggEJ2/E9qK7JKaO/+V9v617TXn+I0ZCAwXav6g a1nN9EihDqraOeNpeSIr3ND5l8VS+QkUK8BdzPZilTcq/ZPDOI3lqn2k0aRqIx5vjP/r 3ICzFbwiJw6JlRQaZMSJi9TvF83d5XDLPCiAdxo2p//ds0TJ2Re7u90ou4hvwJ9M7JBS 8hhTV97e4unhyJsgeL9doGQ94j2WwjmyR0BCpioJhLYOQLFIoHZURIlgPBAX/ACFCnPq iJ4w== X-Gm-Message-State: AAQBX9dc562aEct+pw7byEJR8xOizdmNavUc2zir7w5ID9xT7vE4iLwU UNJdgSc/xbOPHH8quM0D3nU= X-Received: by 2002:ac8:5a43:0:b0:3e4:f002:2b6e with SMTP id o3-20020ac85a43000000b003e4f0022b6emr21541492qta.32.1680202078314; Thu, 30 Mar 2023 11:47:58 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id j185-20020a37b9c2000000b007469cfebee2sm70350qkf.49.2023.03.30.11.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 11:47:57 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id E17D427C0054; Thu, 30 Mar 2023 14:47:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 30 Mar 2023 14:47:56 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehledgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueeviedu ffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Mar 2023 14:47:56 -0400 (EDT) Date: Thu, 30 Mar 2023 11:47:12 -0700 From: Boqun Feng To: Peter Zijlstra Cc: Wedson Almeida Filho , rust-for-linux@vger.kernel.org, Miguel Ojeda , Alex Gaynor , 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 03/13] rust: lock: introduce `Mutex` Message-ID: References: <20230330043954.562237-1-wedsonaf@gmail.com> <20230330043954.562237-3-wedsonaf@gmail.com> <20230330130108.GE124812@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230330130108.GE124812@hirez.programming.kicks-ass.net> 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 Thu, Mar 30, 2023 at 03:01:08PM +0200, Peter Zijlstra wrote: > On Thu, Mar 30, 2023 at 01:39:44AM -0300, Wedson Almeida Filho wrote: > > From: Wedson Almeida Filho > > > > This is the `struct mutex` lock backend and allows Rust code to use the > > kernel mutex idiomatically. > > What, if anything, are the plans to support the various lockdep > annotations? Idem for the spinlock thing in the other patch I suppose. FWIW: * At the init stage, SpinLock and Mutex in Rust use initializers that are aware of the lockdep, so everything (lockdep_map and lock_class) is all set up. * At acquire or release time, Rust locks just use ffi to call C functions that have lockdep annotations in them, so lockdep should just work. In fact, I shared some same worry as you, so I already work on adding lockdep selftests for Rust lock APIs, will send them shortly, although they are just draft. Regards, Boqun