Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3627206rwb; Mon, 5 Sep 2022 15:38:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6u7ZulKmzb6/Hmb8GAue69RGjxsWKJ/s7PpFHxA98/Ch1XCcQ1oFbBVuV34uBglD/A/cYx X-Received: by 2002:a17:906:4d8c:b0:741:6194:e5b6 with SMTP id s12-20020a1709064d8c00b007416194e5b6mr28905846eju.252.1662417504570; Mon, 05 Sep 2022 15:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662417504; cv=none; d=google.com; s=arc-20160816; b=pRT0MWWnnDob+jsF+i5gcegcWQGeFUWARlByLx5FFiy0gVfyQRLRJMIe63I/jKv9/2 AHcZpfOc8n/+LdZgw4F4+YLNZYmSqlJavAR9niu/mpINZ7W/KIHXRDtwQIvIp7+t5tR1 /fNuvGcjTNB1BYreYUkR2AkU35Em7wsiegZaG1bpN+s//+Se7xmGvvI7a/ov1TUmWjnu TuACmcX0ERvvnPvRd6fpg9dX2TCnZvbqdkgc7+jMqUnUKgKPA3Qb6uOSUQeu0gYGXTLU Ia2DZ8b1SPYXbJOfWDd2uEmcJN51hZsg6CR9poQT78lbSXJGTB0bqZUy5WqFNL+g3CSJ IqxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Q4/Z/bg2kDTI6m5rA82hAkQ9BqEdQlGB5olkGauA4tg=; b=jXCq6GAzQr0mknRRtm0dATx0q3GRkSqBvcU4S6uGlJ9gYK9CpIdxiwjDLiH6esckkt h7II1bcXdS/s7k+Myoqpp4wZA20fMp8tT99ZoRBkiHlavlLzALviBJaRvLmmkmLyYOx8 G9/Y8oZS5W/mxaBeq9wc1fphlBio89incHawaw3qgOL1ViWsSKnnaeVufqEazQJKf3AC dLwFZVBTufCgDXsscOYgSYBs+uQjG2r1pPWef2gFPRs/yuhpxkW07jjJ7Giq8bQpOGve qyZy9r9KFOecZ0mEB/MOSumwdtI8TSm8CpNPpFC3+D+s42+dPLvDmhLWW8UQii3Tz1L3 s/1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020a170906c19100b00745db915f2csi7508830ejz.209.2022.09.05.15.37.58; Mon, 05 Sep 2022 15:38:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231142AbiIEWQZ (ORCPT + 99 others); Mon, 5 Sep 2022 18:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbiIEWQW (ORCPT ); Mon, 5 Sep 2022 18:16:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B59559253; Mon, 5 Sep 2022 15:16:21 -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 ams.source.kernel.org (Postfix) with ESMTPS id 1675FB81598; Mon, 5 Sep 2022 22:16:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D5E2C433C1; Mon, 5 Sep 2022 22:16:13 +0000 (UTC) Date: Mon, 5 Sep 2022 18:16:50 -0400 From: Steven Rostedt To: Kent Overstreet Cc: Suren Baghdasaryan , Michal Hocko , Mel Gorman , Peter Zijlstra , Andrew Morton , Vlastimil Babka , Johannes Weiner , Roman Gushchin , Davidlohr Bueso , Matthew Wilcox , "Liam R. Howlett" , David Vernet , Juri Lelli , Laurent Dufour , Peter Xu , David Hildenbrand , Jens Axboe , mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, changbin.du@intel.com, ytcoode@gmail.com, Vincent Guittot , Dietmar Eggemann , Benjamin Segall , Daniel Bristot de Oliveira , Valentin Schneider , Christopher Lameter , Pekka Enberg , Joonsoo Kim , 42.hyeyoo@gmail.com, Alexander Potapenko , Marco Elver , Dmitry Vyukov , Shakeel Butt , Muchun Song , arnd@arndb.de, jbaron@akamai.com, David Rientjes , Minchan Kim , Kalesh Singh , kernel-team , linux-mm , iommu@lists.linux.dev, kasan-dev@googlegroups.com, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-modules@vger.kernel.org, LKML Subject: Re: [RFC PATCH 00/30] Code tagging framework and applications Message-ID: <20220905181650.71e9d02c@gandalf.local.home> In-Reply-To: <20220905204229.xqrqxmaax37n3ody@moria.home.lan> References: <20220831084230.3ti3vitrzhzsu3fs@moria.home.lan> <20220831101948.f3etturccmp5ovkl@suse.de> <20220831190154.qdlsxfamans3ya5j@moria.home.lan> <20220905110713.27304149@gandalf.local.home> <20220905204229.xqrqxmaax37n3ody@moria.home.lan> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, 5 Sep 2022 16:42:29 -0400 Kent Overstreet wrote: > > Haven't tried that yet but will do. Thanks for the reference code! > > Is it really worth the effort of benchmarking tracing API overhead here? > > The main cost of a tracing based approach is going to to be the data structure > for remembering outstanding allocations so that free events can be matched to > the appropriate callsite. Regardless of whether it's done with BFP or by > attaching to the tracepoints directly, that's going to be the main overhead. The point I was making here is that you do not need your own hooking mechanism. You can get the information directly by attaching to the tracepoint. > > static void my_callback(void *data, unsigned long call_site, > > const void *ptr, struct kmem_cache *s, > > size_t bytes_req, size_t bytes_alloc, > > gfp_t gfp_flags) > > { > > struct my_data_struct *my_data = data; > > > > { do whatever } > > } The "do whatever" is anything you want to do. Or is the data structure you create with this approach going to be too much overhead? How hard is it for a hash or binary search lookup? -- Steve