Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2191103pxb; Wed, 9 Feb 2022 12:51:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyX2z5EWOb9k5WFftuGTpEzI8aUKd+u88fBEGmpN9twy5c+vZnRiguvS9SO5/vNQTQEp3WQ X-Received: by 2002:a17:90a:b906:: with SMTP id p6mr4564981pjr.212.1644439868044; Wed, 09 Feb 2022 12:51:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644439868; cv=none; d=google.com; s=arc-20160816; b=gXpoVjsGoTTAuFR9iONdVHzxFwKfMhiHIsvipGDCVg7g+N9P44drA6bTOGEfhJf4eL ZRzCXZLGJkGPa5Jh55g4XNfg0td9jJGD5xTxH7pxTTw6Pq40FH2jL2MijyjqI74tlPrR ikDz/2F6PSBYURZEl6ZsZraBtnoCBZof/jULF5xauiN+5zLTLAdKG8Bt4kub5Pb7iX/j Ds96fRARrlH+jnmo0PrTlmDzSpnF8Rp4m7YD/EfEBOapYc5LSoqjYjfj56bk8TNQqE8e XAYztCUrxyIi76Z/4CMhCXA3RWHut1hjTk7qw3rXJPjDsoTkhojrcgGhb6HZ1wsRsfV4 Yzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KHy+FrMszZUXNvq7VkE1Sw+oLSzIRN5aM5gdNpzgAuE=; b=WdRzgBj9djK+Wh2pQRouCtsrzOvLBdIz5ddCJ9mAI+wD+V1KIKWn6TQmQbQG6qI3QO KHmM62wTGKZnCYf+MqIFejWddXZyLAKsyJiOVCzT6JkkNPoXzgNlj+M4VAwGIT5srVhl sWs8qGhXXRYJ7skVnS3ARKYcekTl6UUKyj2CMr7rtAtbKn9/23LhCkmvpuZjcikGByJ0 rRq3x4QnfuUDTeeJECmZ+kx/9JFstzNvZANEKj/F62n6ZylpKDH/ZGCsmhXFERLbIE1a 4txYyBSbE54wzMslntNJQGOIWzh9ZRaSfglRfwEh181+D1LQrQj3S9n0VCj4ROOi0KKx u/Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QWpkt8Rx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d11si16581561pgg.106.2022.02.09.12.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 12:51:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QWpkt8Rx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 72D2FE03B9E9; Wed, 9 Feb 2022 12:20:15 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbiBIURy (ORCPT + 99 others); Wed, 9 Feb 2022 15:17:54 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:37256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbiBIURw (ORCPT ); Wed, 9 Feb 2022 15:17:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3A757E030D42 for ; Wed, 9 Feb 2022 12:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644437869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KHy+FrMszZUXNvq7VkE1Sw+oLSzIRN5aM5gdNpzgAuE=; b=QWpkt8Rx7zxPIlCq7TT5uu/V7eU0lUUgZFYhIbk5ieJAUEqQocehCIuitrDtqlzK/rLp7y r8/mlmr+NJuVpH9UJIYCwM/b30fq+pXepIjPamun8g20HiI3G7GPNUWAK693qOyZUGDW9O Xe64LEpQXJj7QIB+5ZBDrvctGV07reQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-62-9Cqsjq2nPzOSvqBNqWFcoA-1; Wed, 09 Feb 2022 15:17:44 -0500 X-MC-Unique: 9Cqsjq2nPzOSvqBNqWFcoA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E37D4814243; Wed, 9 Feb 2022 20:17:41 +0000 (UTC) Received: from [10.22.9.207] (unknown [10.22.9.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12EB55D6D5; Wed, 9 Feb 2022 20:17:38 +0000 (UTC) Message-ID: Date: Wed, 9 Feb 2022 15:17:38 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1) Content-Language: en-US To: Namhyung Kim , Mathieu Desnoyers Cc: 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 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> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 2/9/22 14:45, Namhyung Kim wrote: > 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. We may have to invent some new APIs to do that. For example, spin_lock_exit() can be the counterpart of spin_lock_init() and so on. Of course, existing kernel code have to be modified to designate the point after which a lock is no longer being used or is freed. Cheers, Longman