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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 959A1ECAAD5 for ; Mon, 5 Sep 2022 18:09:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231162AbiIESIw (ORCPT ); Mon, 5 Sep 2022 14:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbiIESIf (ORCPT ); Mon, 5 Sep 2022 14:08:35 -0400 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BB20606A0 for ; Mon, 5 Sep 2022 11:08:33 -0700 (PDT) Received: by mail-il1-x136.google.com with SMTP id v15so4938781iln.6 for ; Mon, 05 Sep 2022 11:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=hbTvjCqXtfZwCNAPDugxhLvbO4tPW4uXsytclFMPf88=; b=BWl6tEU0Jv/5Ok7izOy2X+2XFHIjW2yJwE8yMIwADusWnEOeQC8si1U6iks3IFTXtR 5tbbeyYCmyTiKFNMcU3D2cV+gb/s5ohOcUII9kU6FU7ji/Zh8BrlwKsCQaRcerXV6BGZ 8PlGGmZZYHPvdH+WgSsyR10w9r/j2bW/3D0lAGkx1tIn87fB5RB3pcjDyqMnvPGCsyas uH/yoycyrf5kaO5p9L7J37V/vDYJvxKCrEBpA8AorAMThecIv/vXA5VLdyTk9mhWPhlm xhk4J8Awk+fBDhqAh5Kc3xuDELqvWV7xGoRQ08TJNeQzRqgNOVW6ruxsZF0Lyj7+Dw3B m0Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=hbTvjCqXtfZwCNAPDugxhLvbO4tPW4uXsytclFMPf88=; b=z41pWFIWOOxdwZEk2ftY4y2X8j0WhvnDxPFhstqGkBu4vEsrqnYq5QbiRlXhXEGWBu Oo5ioVhZ48xM4wboV7IOBZVh8xCFKu7fTJSbhgWKtQlx+yfCMCgRRuBqterMdqooh7mA bAkOUA2KEX5CEAZVS3mUMEK8eEIDkf11/VwtEBOyCLDY9UkNkTIxgQEr5KFJcgmwoBY+ okl/SSqcZ3Ae7vb3QjgqpKhAeahrrxQpXu4Vg+vLuMdnFt8e5vnASbKh0wU/o+1nd90k aYMyrLi37yjA0ix3h3q6iWtR1ej13VpJlwEsQh9o3ytRkACSLLfVpIMPY+85UF5f7cIB C3Bw== X-Gm-Message-State: ACgBeo3srbPTn/MzSLT3uJQLQOiXwhwd7ndT5mNj6bcI+6yBYHYnbGJV V9H2GL1TEAmf3NeAA2Vehl2lwVHuU7LOc1nuOMlJhA== X-Google-Smtp-Source: AA6agR4Rv/lC85vS43o4ySf3NvmJunla0lbszDaoWXhv+p4vulk9P6WBBoE0T5B+Wry+ZoXPm1CE94n4VZxipIKzyxQ= X-Received: by 2002:a92:ca06:0:b0:2eb:391a:a2a4 with SMTP id j6-20020a92ca06000000b002eb391aa2a4mr16719486ils.199.1662401312639; Mon, 05 Sep 2022 11:08:32 -0700 (PDT) MIME-Version: 1.0 References: <20220830214919.53220-1-surenb@google.com> <20220831084230.3ti3vitrzhzsu3fs@moria.home.lan> <20220831101948.f3etturccmp5ovkl@suse.de> <20220831190154.qdlsxfamans3ya5j@moria.home.lan> <20220905110713.27304149@gandalf.local.home> In-Reply-To: <20220905110713.27304149@gandalf.local.home> From: Suren Baghdasaryan Date: Mon, 5 Sep 2022 11:08:21 -0700 Message-ID: Subject: Re: [RFC PATCH 00/30] Code tagging framework and applications To: Steven Rostedt Cc: Michal Hocko , Kent Overstreet , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bcache@vger.kernel.org On Mon, Sep 5, 2022 at 8:06 AM Steven Rostedt wrote: > > On Sun, 4 Sep 2022 18:32:58 -0700 > Suren Baghdasaryan wrote: > > > Page allocations (overheads are compared to get_free_pages() duration): > > 6.8% Codetag counter manipulations (__lazy_percpu_counter_add + __alloc_tag_add) > > 8.8% lookup_page_ext > > 1237% call stack capture > > 139% tracepoint with attached empty BPF program > > Have you tried tracepoint with custom callback? > > 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 } > } > > [..] > register_trace_kmem_alloc(my_callback, my_data); > > Now the my_callback function will be called directly every time the > kmem_alloc tracepoint is hit. > > This avoids that perf and BPF overhead. Haven't tried that yet but will do. Thanks for the reference code! > > -- Steve