From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16034ECAAD3 for ; Mon, 5 Sep 2022 23:51:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CD2E80234; Mon, 5 Sep 2022 19:51:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 755E380224; Mon, 5 Sep 2022 19:51:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CEEA80234; Mon, 5 Sep 2022 19:51:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4A22480224 for ; Mon, 5 Sep 2022 19:51:13 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 193291C550A for ; Mon, 5 Sep 2022 23:51:13 +0000 (UTC) X-FDA: 79879680426.13.0357B50 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf12.hostedemail.com (Postfix) with ESMTP id 9B5A54007D for ; Mon, 5 Sep 2022 23:51:12 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662421872; a=rsa-sha256; cv=none; b=UsflFFoqUYY6lHDeQibxnTibAUTSav4DNDWXljsYxLO9EdhTPussdXqlkHhEqVQPh1v7rV ak/rZ8OhHd5m/lyMWe2vdnW3ZGgwyiAewGC1XWRYV2oFg620mzYO8I67+7F0Mpr8kxF3OK ZiMXZuwnWhTpy8W/nntlzVXLzLJq1as= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=K0AUlJQw; spf=pass (imf12.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662421872; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L/QtR7clKwa18sm3kCbVwFkkFjR319r9zDLdSKgBl/k=; b=UO5J24IF/44tpHHTHEHGYIP+U0HtuPbfR8eOozAy4NnN+mFPgZ4zpdhRk3hMYVahYqpsvE BnSl1W67Bt2dT9p0h0BvYKr71a/YuO8jx5ZICxgDm60Yx0lZxZeRfx9xK+tlCQNISz9Aij XwpgyVcbnpJ3KbymPtsSlrfbTWtzxek= X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=K0AUlJQw; spf=pass (imf12.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspamd-Server: rspam06 X-Stat-Signature: 1qkwoufrwisnjsyg7n5hu7fg6iibmqp8 X-Rspamd-Queue-Id: 9B5A54007D X-HE-Tag: 1662421872-28419 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.