Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2188135pxb; Wed, 9 Feb 2022 12:46:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJz97tut/GeC6XS17cvqyu15mw1QC/TbpHc+hETaVe1qZnRDRFstXrfxw302VGR720hrfFko X-Received: by 2002:a05:6a00:1681:: with SMTP id k1mr4151036pfc.48.1644439603416; Wed, 09 Feb 2022 12:46:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644439603; cv=none; d=google.com; s=arc-20160816; b=XmDfdJHrjL1/sff7u5fGMtwn9bUYPMw3k1VqBZgRUDnRMjRi9Qjj9pu8aL2ECpp1Vz 0dPO0jhDovtgRA/IL5O+5XC6h0JUpScBTJptaCLN2gf+e87SbxUAnFbDTFYwY84sWOZg pFeHYVEjMBTEnmy7nfhJCYfTokrx2Y0Y0RdUs1fdCCeRJ7lNvYf9kteoAIU5L4ouVU5S s/hZZwZycDAiAGCrQjvaEto+2JbfAqoqEtHzUXenmbiZev6qnL5EcGtJDDFc4Y/1/DKs 1Lu8OsF/RZe45fB98X8GqOaEk6/VLNJI5m4YLiMZOFx2XOQ1+MPxSK6SNt2rhpgezpSl MNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=mI+M+mpK8d6GUtu7pCBOaGOdu7sx/dJ/6QGGwi/Jk00=; b=hwQ9Mwc3+e1eWUEg+qQ+DkO3IqfbRP+OIkMEbfCelsVDg/S1n4NpQMxFZp7ZUplSD2 mqETJbmSrTVkn3ueKTEdyMgLANkm6kZJbVH+XmDRJCGAPtj1TgR3JiGolFsRiNrCujH1 UDLHxHt6If5CnTOGYZUELs6S0Vp5CFT4hiV+lxgIZKvaB2FDnbI6s86v1UjiO0sYKmlm Pp6WrspapmVbg/vWqgtpITiVed1WP/OqdHLqXSQbyaoAuIx71Sxf16QKYIs1+RFcvdWH HPlAuVpJi3/mcvKquZxoCkmSRF+77RL10OoG7HwkRpfyHrM3A7PTpBQAbsUxHSImDqSy 4zfg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y15si15545772pll.552.2022.02.09.12.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 12:46:43 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27697E09229D; Wed, 9 Feb 2022 12:11:55 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbiBITqR (ORCPT + 99 others); Wed, 9 Feb 2022 14:46:17 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:51690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiBITqO (ORCPT ); Wed, 9 Feb 2022 14:46:14 -0500 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 178EDE00ED60; Wed, 9 Feb 2022 11:46:12 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id n24so2254101ljj.10; Wed, 09 Feb 2022 11:46:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mI+M+mpK8d6GUtu7pCBOaGOdu7sx/dJ/6QGGwi/Jk00=; b=BPBcR5MWpt3lJzgo3WfePMLWbEtab6Sso6wUGTMDZ3JAWFfnI6d0x0IFL+B9+sLoMd Mc3x3Dr/TUmvA+0wl0XRBC51hiBHdeFWPXMABsvCHMmCmiX/30YOASqUAUdjCRBKmuAq BOGqS3g99JPUaVTOHatodmWBeEEPaNGXK594IDRnwyzY1acBovzPnkSVXPnyCx+aOxys tlDu7G9T8QTcS0fIE3TKTnv/XH2OUaU0vsZkcIhnzp0m9s2zzIWsqzomZm6WtmN8btbV LoIC36OuWFRc9pd9U35ASlVdRhy9maip2rF4iLFf/JOccuLFUslK7p+h0p2U1iVMfIyy Br6Q== X-Gm-Message-State: AOAM5335ZfvzznOeGsd5F4K3V0W+YbPcbZ2XjGE14eQhhyST419rGfbB xMs51e/WEMriMff60PayPiqE+1l9HkRubOBykPc= X-Received: by 2002:a2e:b611:: with SMTP id r17mr2522075ljn.457.1644435970319; Wed, 09 Feb 2022 11:46:10 -0800 (PST) MIME-Version: 1.0 References: <20220208184208.79303-1-namhyung@kernel.org> <20220209090908.GK23216@worktop.programming.kicks-ass.net> <24fe6a08-5931-8e8d-8d77-459388c4654e@redhat.com> <919214156.50301.1644431371345.JavaMail.zimbra@efficios.com> <69e5f778-8715-4acf-c027-58b6ec4a9e77@redhat.com> <718973621.50447.1644434890744.JavaMail.zimbra@efficios.com> In-Reply-To: <718973621.50447.1644434890744.JavaMail.zimbra@efficios.com> From: Namhyung Kim Date: Wed, 9 Feb 2022 11:45:59 -0800 Message-ID: Subject: Re: [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1) To: Mathieu Desnoyers Cc: Waiman Long , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , linux-kernel , Thomas Gleixner , rostedt , Byungchul Park , Radoslaw Burny , Tejun Heo , rcu , cgroups , linux-btrfs , intel-gfx , paulmck Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, Feb 9, 2022 at 11:28 AM Mathieu Desnoyers wrote: > > ----- On Feb 9, 2022, at 2:22 PM, Namhyung Kim namhyung@kernel.org wrote: > > I'm also concerning dynamic allocated locks in a data structure. > > If we keep the info in a hash table, we should delete it when the > > lock is gone. I'm not sure we have a good place to hook it up all. > > I was wondering about this use case as well. Can we make it mandatory to > declare the lock "class" (including the name) statically, even though the > lock per-se is allocated dynamically ? Then the initialization of the lock > embedded within the data structure would simply refer to the lock class > definition. Isn't it still the same if we have static lock classes that the entry needs to be deleted from the hash table when it frees the data structure? I'm more concerned about free than alloc as there seems to be no API to track that in a place. Thanks, Namhyung