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 DAD17ECAAD3 for ; Mon, 5 Sep 2022 22:16:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 252018022D; Mon, 5 Sep 2022 18:16:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D95B80224; Mon, 5 Sep 2022 18:16:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 052D68022D; Mon, 5 Sep 2022 18:16:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E69A180224 for ; Mon, 5 Sep 2022 18:16:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B419D120177 for ; Mon, 5 Sep 2022 22:16:20 +0000 (UTC) X-FDA: 79879441320.21.CBF11A1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 57931100076 for ; Mon, 5 Sep 2022 22:16:20 +0000 (UTC) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5612C60AFF; Mon, 5 Sep 2022 22:16:19 +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 ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of "SRS0=a78l=ZI=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=a78l=ZI=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662416180; a=rsa-sha256; cv=none; b=t6j6b42vUa5Hnl3OdsU1vQuoMCNONmnlxLeJXDTQOcg/fyzeLZcfCkChqA4SynuG0MEqeC AsT3fs86d1sb50eGc7i6E5spC2O64V2F4TnUikJM58RjppAG/gnOS7XE0aS+KIgqoegPN+ g5ChJGHuTV/Kn9XQjq8CzkRBywyOO48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662416180; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q4/Z/bg2kDTI6m5rA82hAkQ9BqEdQlGB5olkGauA4tg=; b=UdRiaS9LkjQ7ut2/BR+sDE0ERCYFd3vF30vdcv3Oj+PhQuiL5+cv4ZZkNmYyBACpK7x/4y iUE8XspT0T+Qlka0h1mbRBawSGGdnPqSrEAIjpD51c2XLvCFoQ3FE+FvOFd5xE2dsX2ZJU +Q8O6jwh3dPhU8UH1Zhkk8IzC5Kssv4= Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of "SRS0=a78l=ZI=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=a78l=ZI=goodmis.org=rostedt@kernel.org"; dmarc=none X-Stat-Signature: zahaosaqxaf7qfhfsycd8nx5bhc5ccdn X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 57931100076 X-HE-Tag: 1662416180-272892 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, 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