Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp981420rwe; Wed, 31 Aug 2022 14:49:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+DdCLSczqLiZs+mUm7xLcBUJZVz+2LzQyCGjyUusf2W9wlOg8PCSNnj7Q+tfRLscW+kxi X-Received: by 2002:a17:902:6949:b0:175:4e37:c29f with SMTP id k9-20020a170902694900b001754e37c29fmr3156755plt.69.1661982591355; Wed, 31 Aug 2022 14:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661982591; cv=none; d=google.com; s=arc-20160816; b=DpiiBXIznLx4Wi2l+vw7cHrtQXCTJZyOkHvJ2uxlXvfKP/mL+J/jk7Ph2H4taeIc3Q hcaWXuclXQapcHhtQBMAzyGhTiIoIv2DuVsG1SoRTdJh1+RShx8Kltdf+G3QCy/xLLrB eVqZcFsV2XaHQUr+rEgP4DlxUTEGjcOrVQF7I1DDFf/5K8TEPBPC6G+E2Cqembqswe8/ HU3URKMa6Z3ZoUvbuOYN9T8vI3E+vAXxL03yc1D/vnH92XxY8xfNdklQ68AN2JhQZB1N xah4dKeQNHj5NjCEtGZh3aVAHkgeyVJ6nHZLim9HpTJJdzUR8o9RIsL0ak3sJR9Kryzl FZUg== 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=6E7G6kJMNs5Us6NEnCBcT2HO6AKiMVb4bH/0vpPA/4U=; b=VXMhcqXmHIq+1bflDDlkQ/7v/hIeUG+BhooVFmAUX0UU7HLW1uld3oYTFU+3g0qrSb 5BSc+goK/8iDKQmE5qDfj6YMNIkVgf5d/6mZKFFlGgVTVwMSrkGVlkHzDQqWkdeaINmW BmKqaBvT13s1Ef8WpNyQi5xMO2c9EHsqKNESx856vxvsn9vT1ZbgnNh5e9bJpw5dufiQ 0WQe1Q6IL1KttskpoNIZwjhvyxq2jLdj+Z+rdAaf5D2UfD5KGmHP0gkOzd6G4oWEh5z/ X/n3bJzJtrPHYgR7DD3IDo9ctP6tu1kGa0v18LcHw1RhtoqERhkp+Ydz0aKLgV/6k/63 pyMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kAtSEhj7; 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 a24-20020a1709027d9800b0017302a457a9si13920456plm.270.2022.08.31.14.49.38; Wed, 31 Aug 2022 14:49:51 -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=kAtSEhj7; 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 S229813AbiHaVi2 (ORCPT + 99 others); Wed, 31 Aug 2022 17:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230357AbiHaViW (ORCPT ); Wed, 31 Aug 2022 17:38:22 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1046D7CF8 for ; Wed, 31 Aug 2022 14:38:20 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-3321c2a8d4cso319670307b3.5 for ; Wed, 31 Aug 2022 14:38:20 -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=6E7G6kJMNs5Us6NEnCBcT2HO6AKiMVb4bH/0vpPA/4U=; b=kAtSEhj7BWkD6SMRdd1t39qS+hQKouRS4qaWZ/zCB6oGUrFNrc2cBDYGv9jQ+MdF0J uxQpVt2B9TyIrWXDxJ2lE/5kGqIlaGR3KL1ZUwaFBmwiXzmcYyLDuUovokIJ5gP+z9l0 0yNTpmhlKudmxd6FSbYJNy7iPqg2dLLVGTx3y1J7sDru+O7/1p0gaM3HCn5KVfOBeHdH 7y51BAxidLFb2zqNvKSOOe8d+T3vU43qoJCQXNWAECkcBOpBA8zLImxhZz3blz38Sv8b A0VOTCczeuCjB41nhG0Ij40swVSwGGlY/9vVEbUAh5KhCZEJca7FVQKBTYw0uiQMXn3I 8fkg== 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=6E7G6kJMNs5Us6NEnCBcT2HO6AKiMVb4bH/0vpPA/4U=; b=qex2C1i3kUlE5J65dYQTX9n3bJrMqINH1UTW/DBw3P7qmt6ltOCdMqiOtZbCYN8jX3 6KM543yzDhxIpCjiOMuGBm91TfgLVVd3yLnOqRf5ApCDriRh090Iw6fEJXW+I+sL13tT 1OXH6p+EnWm9z1nD9jpeg/UHI91PqScgcUXkrtIE+4omaIHvKG01Q2iHrurgfs+Oipn9 E5uYhglEiGdW3xvXS/1bW3xtuZaXnEbXyYuFsUHE9J/ICCKoNUjK8E1vctvrDLQHr8IB arh69aSGzrJ4GL9tTVaz4Q5bm1BzVQzI2jtEN7Pao76muv5ydwFsaHCmh76gUW+E9KaS PYkA== X-Gm-Message-State: ACgBeo2wBT9BUpxmJXhUTCqTwpuVYl0sjw+nBx/Li2dh5AOD461kvd4F 3ztQpwICKbAKsh2lgN1W62Ba2XPF7KKlrdgeYODuoQ== X-Received: by 2002:a81:85c3:0:b0:33d:a4d9:4599 with SMTP id v186-20020a8185c3000000b0033da4d94599mr19726685ywf.237.1661981899638; Wed, 31 Aug 2022 14:38:19 -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: From: Suren Baghdasaryan Date: Wed, 31 Aug 2022 14:38:08 -0700 Message-ID: Subject: Re: [RFC PATCH 00/30] Code tagging framework and applications To: Yosry Ahmed Cc: Kent Overstreet , 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 , Steven Rostedt , Benjamin Segall , Daniel Bristot de Oliveira , Valentin Schneider , Christoph Lameter , Pekka Enberg , Joonsoo Kim , 42.hyeyoo@gmail.com, Alexander Potapenko , Marco Elver , dvyukov@google.com, 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, 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 1:56 PM Yosry Ahmed wrote: > > 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. I had the numbers for my previous implementation, before we started using the lazy percpu counters but that would not apply to the new implementation. I'll rerun the measurements and will post the exact numbers in a day or so. > (Sorry if you already posted this kind of data somewhere that I missed)