Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3439908rwb; Mon, 5 Sep 2022 11:41:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR69nNh8POSX3RHetZMH1KH6zSdzMLl8T4wijkdZSQOB/qN7mfuUeM0ttZ47sgKRhLGzB2bI X-Received: by 2002:a62:e418:0:b0:538:19f2:6e1b with SMTP id r24-20020a62e418000000b0053819f26e1bmr42317286pfh.71.1662403262214; Mon, 05 Sep 2022 11:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662403262; cv=none; d=google.com; s=arc-20160816; b=fqGsmUA0va2Lbz610JsQvjcqcOec2ekMkP+a9ilaR9wcENE46S+0ikLDjC0P7BXsoV Ggjc1aCpwz89fyw1syaUoQu0+9cYsVy9OP7G8RNVw31H2MglYD6aPL762iohDSzT95DF WpIwPtT0v+zW5Lc4WEeNE7/bdmCITQqUBbHiLO2ZtY5Wu9IR4QHL47Yq0JpaGF7O6DTO DzL+TbWWbSW3v/TgRwqxcwL5vSVTVDAxlNKYPmk/xZB1i9SunAf9hkYpshKL0elHQLUg /ndDbD76URrdcGcjU4trmvz8I+nJRJWyIEbjHW6MbTzUKdKw1A17iCaII7OxDpAKiFMB gLCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hbTvjCqXtfZwCNAPDugxhLvbO4tPW4uXsytclFMPf88=; b=KGcg1qdD8KLD63leTU3Yh6TVT8ZNwaYXsD2Mo2RFR1uUyi4BADl3c84c6tkZD5PQsp QuDwcsTj0R5rjYmu4AQ0Nj398X1XFSxF8lBf8usN2sf+TZtZHHyGdio8o3WAe8/x+Jzl omBC4ITHzhOFDzwdaOKZ07A7X2SBfCvP3fqsyDuddO7zlExY005uNBFr27awrIdXdaJs GajdxyXcka7PHriU1cx8UPHL2YNHLDJs7Uvs4jO+oLljklvPpMI3SyQC3cXeFL7Cbj2J W2OtO8P4m33C6BkkxbkCHTxumi92UbBtr1GT+C464mArU4ZxRlwzi3QiuHzspxaM7Pa3 JKlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BWl6tEU0; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020aa7820f000000b00535e3dc1519si10266695pfi.64.2022.09.05.11.40.50; Mon, 05 Sep 2022 11:41:02 -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=@google.com header.s=20210112 header.b=BWl6tEU0; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231933AbiIESIh (ORCPT + 99 others); Mon, 5 Sep 2022 14:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231162AbiIESIe (ORCPT ); Mon, 5 Sep 2022 14:08:34 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 582F46069F for ; Mon, 5 Sep 2022 11:08:33 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id r7so4936086ile.11 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=QvSnrTsKuGtagEjCMx3ixO2qqFWilXz24B6c8EXcD7KeXM9G7LUdypikR88JCk6VAy BJwIlZt/jXobKCJ5KqqN1jmYXd2ZSBESQcFpJkerhXNoTWyBBekfoodQmccWqIfs8D+U dcwhSzqMUkgK0MQOz2z515yHMYvO2I8VMlyicGw1rJliFap1qbVyeFSGnC13mxNmI9k7 mrF76yMAZuIW3Xc+u3MK/2ztAa2DNluYnPyifnViQEY/zVguSj24b8AHHrE+E+LdMIWH M5aM8v0bgoeVtgnRYLKi8UuFynTcdmLPeAQbYKuC6eCSLhSkOHZEEcSZyBtqwLPXG+YH INnA== X-Gm-Message-State: ACgBeo0AgE5NWpMW88F79ZPTXuWdvVmKJY0pLupSwYMIN78XzcptZIiN 2oAH2AU14GTTMiDpeAxtf0qORaInZXgtn25K1VF85A== 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" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 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