Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3699614rwb; Mon, 5 Sep 2022 17:11:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uvDIXe1DquQNqaF4shvaHBf4lGceQ8VevboMiVqJ1l55mjEybIQ6A5AC1WeZywycZ07e8 X-Received: by 2002:a17:906:58d1:b0:76d:af13:5ae3 with SMTP id e17-20020a17090658d100b0076daf135ae3mr3611651ejs.708.1662423072280; Mon, 05 Sep 2022 17:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662423072; cv=none; d=google.com; s=arc-20160816; b=eUgjobM9NGwazqmLSFY2Tj4fEcQYYX/I5tCbckZnWVgl7rfWbzYN0AiwvNhhUI9Vbk gGnWpTBiprjisCe1t9/O8ymwbJ7PqL+xFmNuXvpC91tydVSR5fogG1hl1rMZQLbOPZ+l aDg7faaAO06rnvUnMdFZx5JEOPUPztQrIJglU3w1RcEzx5+R80GzmUhkNlAA8p9gg0ZR zYxTTiaG7ufgNkbB7TP7nLgkhyXG7/p2yJNyqil8/ikCl163VPz1Cwyi5iZjogvl9zXj Dqtcgrn3eWK/Tvzt4aifhlWfQIyLl//GvT574S2qMRNcixBl/ocVyIsTDbTRBFb/dy0t QTig== 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:dkim-signature:date; bh=L/QtR7clKwa18sm3kCbVwFkkFjR319r9zDLdSKgBl/k=; b=n914DmiEvEFL3Yd5hw/BwJBDjk4o24z3EJ7a2ZPz1NKoALuIii+LP7UCuvDDyB4zXg FhuEqHenSPj8T3zWDHHiespfzozglftszigbb2v3vlkNYM930RTyKzlNb06mnXnBBsn9 RU8j8MMpgymBPV+cxSvEnoYVzLYcxkQlajAmBGz/6KWrotBY7t4bHxkL+9OKZv4Rczar S4VMYq2G9WScDPLBrG9t7dn7EG4wK6TIB7eCM0wlUxhDqqI2spvjF2ydoShQksEDJoYl RQN6nac/YfD5JX8dPUqkUXWLom+MbSZfV8ZGX/5JtrheQrga8eboi74oqJt2ATeVs4V/ XnIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=K0AUlJQw; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp5-20020a1709073e0500b0073da90f1996si10139573ejc.683.2022.09.05.17.10.43; Mon, 05 Sep 2022 17:11:12 -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=@linux.dev header.s=key1 header.b=K0AUlJQw; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232560AbiIEXvX (ORCPT + 99 others); Mon, 5 Sep 2022 19:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232549AbiIEXvR (ORCPT ); Mon, 5 Sep 2022 19:51:17 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9E8501B1; Mon, 5 Sep 2022 16:51:12 -0700 (PDT) Date: Mon, 5 Sep 2022 19:50:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662421870; 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: in-reply-to:in-reply-to:references:references; bh=L/QtR7clKwa18sm3kCbVwFkkFjR319r9zDLdSKgBl/k=; b=K0AUlJQwh12ArX3Ivo5AajZFTOnj8fptPh9b/mWIPD8nscGPgO8kw0SNz+Kn/2nIaB9e9i 7R3FAk1ULpUqZb/f26WREIzq78CmF0IzVffZPJjJ7RbMsrYAMZ8f5FwzvnmygEisggBmw5 5Icx4XHaZKC0M/ASUBy2hcvuJroZdmk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Steven Rostedt 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: <20220905235007.sc4uk6illlog62fl@kmo-framework> References: <20220831190154.qdlsxfamans3ya5j@moria.home.lan> <20220905110713.27304149@gandalf.local.home> <20220905204229.xqrqxmaax37n3ody@moria.home.lan> <20220905181650.71e9d02c@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220905181650.71e9d02c@gandalf.local.home> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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, Sep 05, 2022 at 06:16:50PM -0400, Steven Rostedt wrote: > 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? If you don't think it's hard, go ahead and show us.