Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp974545rwe; Wed, 31 Aug 2022 14:40:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6L2g7yzbpv8Ve1ESNRZVgdRPf//jizTMUFknT7PPXhJCfX7fqugB7t2nwNuPGi4IZ2Lx8O X-Received: by 2002:a17:902:ef4f:b0:173:353:3f6c with SMTP id e15-20020a170902ef4f00b0017303533f6cmr28177963plx.6.1661982037175; Wed, 31 Aug 2022 14:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661982037; cv=none; d=google.com; s=arc-20160816; b=z+gzi+za0xFZJqwLBCt3DfB7jr4IcCBwDU+j/CjSMEmGcjKOpcmRYGaeKY1SKzRY3O g6l4rJnWZfUH93MCdjlTdx+wRItScR6+7FeBIy/szRnr45PS9A929LI0gd4IL3oKvQVx w6k1PZ6vprbpXWyW+4dp1WzxXEWvyZZ6phUOEcrCPEFtOEvezo71dkROHd0XIHEpUr/R u0WnsD8T2CgluESk/M/UBKm3dHfwE7x6mGEGtArvQnjUpCMQgF5ZlJhhINXj++1jn2z/ nq148916y+cWhrsmmrxWyQjrtJo/Ui8KKPxEIhljvpvSbrpSomI3zbsRddTQRXuMHcO0 65zQ== 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=Q+TlttOrTWNB3q3o6Zbb04N1wsFemMMzZbBDHk1hdbY=; b=QyCmsh+ALb6OxwJzlIwSW6QGinEh5CmJkX2zho0S4RTGndV1A1X3ivu6cgrvz6QlY+ UCzYddaJQGMOUk87xxy2jMhet0AkWqhQGRmJkoXiLe0+raDVxtgg9hpOYXSWr+qCT+O5 Q2mpXLN47K7vlKmWYOvXEpwlHcfpLLC5mdS1Ss0eB/b2pThZfIZ5oECVAXw2YFu4dwJR +iZ71zAA/6y8/rsg02gyZs2WsSaLv8VyDsHEWdj37pqlMCEzCzmdbK+GtO2tNGNrHebG RwZU2szasq0TlD7vpfeS+e6KzxGbUk4tUOu+jBr53dC8445FVG1jG/n4tgzMv6MWASZW LvyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VyP3SbNs; 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 f21-20020a056a00239500b005108171fe28si16422116pfc.162.2022.08.31.14.40.10; Wed, 31 Aug 2022 14:40:37 -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=VyP3SbNs; 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 S231743AbiHaU4x (ORCPT + 99 others); Wed, 31 Aug 2022 16:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231802AbiHaU4t (ORCPT ); Wed, 31 Aug 2022 16:56:49 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F73DC089 for ; Wed, 31 Aug 2022 13:56:46 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id c7so13136725wrp.11 for ; Wed, 31 Aug 2022 13:56:46 -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; bh=Q+TlttOrTWNB3q3o6Zbb04N1wsFemMMzZbBDHk1hdbY=; b=VyP3SbNsuyxc5blP2FoCVyjA1CBQu5fk1qPBiWwHnsN7KbhALhPVRs+hdxfauKkrjN HjpFIvR9qflpc5b/NaZbUp4Qe+yoyJx8jmIG71feNwOicipxd4Z45zOK95SSSmFlFqg1 JlDxmSa+dos6d565oincRG6QsILc3r0lbpSqflqmVfv9TWNY+mQW2VINkINO6wGxloda V9BbsnXdjx9TWnVhm9AxW/SNuwlNLiahxr1xh25VEX0zm/Rv6sxPCVqP3nUxZGj48fmq 8freUAXARJQoL1m1MzSBuxjvucYwjbHks6tBHAAViJ2OqT1E6YeDUp+dfTHOL3fNg2CJ OS0g== 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; bh=Q+TlttOrTWNB3q3o6Zbb04N1wsFemMMzZbBDHk1hdbY=; b=MRYTNdyBTBC6Qvj2hDX5iEBULRgnej0VxwTSVts5FrhZGUhETartKQTYff/PbfXqx2 xINuQ4eYUGZGkWwHjlcA1olKfzbzdlu6Kllw8HdgEKCz6MI/ErXYWwAn6l11mV2L4S2L sI6jeFq+ToggsD4KqBkZ8CRahVqRHNqOqX3/yycYA2J/3sfiI4QwapD4fNT0aBZR6Qjg 93zZfi0Agy0zE5AgqaWmEh/o2m2krX5X8yRX7lVeKQL3mG2NZYpnLjGgc8yLe+cwjJti 75L+fBAe1jmcS4Nqw/LfYDJSpGp842eHKJ1iq4eoQInv/dy/KU+t+Hty3I+rW93pSU9n 4/zA== X-Gm-Message-State: ACgBeo1KIGpTaRjVhpm7VfpijQoBS+eLrjA9RZKGpo4hLYXob15VVPGa V5P6jm05PmqfuzgxeiEwtmm7y8cVsk22G8hbYdCRIg== X-Received: by 2002:a05:6000:1188:b0:220:6c20:fbf6 with SMTP id g8-20020a056000118800b002206c20fbf6mr13193874wrx.372.1661979404912; Wed, 31 Aug 2022 13:56:44 -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> In-Reply-To: <20220831190154.qdlsxfamans3ya5j@moria.home.lan> From: Yosry Ahmed Date: Wed, 31 Aug 2022 13:56:08 -0700 Message-ID: Subject: Re: [RFC PATCH 00/30] Code tagging framework and applications To: Kent Overstreet Cc: Michal Hocko , Mel Gorman , Peter Zijlstra , Suren Baghdasaryan , Andrew Morton , Vlastimil Babka , Johannes Weiner , Roman Gushchin , dave@stgolabs.net, Matthew Wilcox , liam.howlett@oracle.com, void@manifault.com, juri.lelli@redhat.com, ldufour@linux.ibm.com, Peter Xu , David Hildenbrand , axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, changbin.du@intel.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, Steven Rostedt , bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, Christoph Lameter , Pekka Enberg , Joonsoo Kim , 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, Shakeel Butt , Muchun Song , arnd@arndb.de, jbaron@akamai.com, David Rientjes , minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, 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, Linux Kernel Mailing List 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=unavailable 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 Wed, Aug 31, 2022 at 12:02 PM Kent Overstreet wrote: > > On Wed, Aug 31, 2022 at 12:47:32PM +0200, Michal Hocko wrote: > > On Wed 31-08-22 11:19:48, Mel Gorman wrote: > > > Whatever asking for an explanation as to why equivalent functionality > > > cannot not be created from ftrace/kprobe/eBPF/whatever is reasonable. > > > > Fully agreed and this is especially true for a change this size > > 77 files changed, 3406 insertions(+), 703 deletions(-) > > In the case of memory allocation accounting, you flat cannot do this with ftrace > - you could maybe do a janky version that isn't fully accurate, much slower, > more complicated for the developer to understand and debug and more complicated > for the end user. > > But please, I invite anyone who's actually been doing this with ftrace to > demonstrate otherwise. > > Ftrace just isn't the right tool for the job here - we're talking about adding > per callsite accounting to some of the fastest fast paths in the kernel. > > And the size of the changes for memory allocation accounting are much more > reasonable: > 33 files changed, 623 insertions(+), 99 deletions(-) > > The code tagging library should exist anyways, it's been open coded half a dozen > times in the kernel already. > > And once we've got that, the time stats code is _also_ far simpler than doing it > with ftrace would be. If anyone here has successfully debugged latency issues > with ftrace, I'd really like to hear it. Again, for debugging latency issues you > want something that can always be on, and that's not cheap with ftrace - and > never mind the hassle of correlating start and end wait trace events, builting > up histograms, etc. - that's all handled here. > > Cheap, simple, easy to use. What more could you want? > This is very interesting work! Do you have any data about the overhead this introduces, especially in a production environment? I am especially interested in memory allocations tracking and detecting leaks. (Sorry if you already posted this kind of data somewhere that I missed)