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 CACEAECAAD4 for ; Wed, 31 Aug 2022 20:56:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D0156B0072; Wed, 31 Aug 2022 16:56:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 07F0F6B0073; Wed, 31 Aug 2022 16:56:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E61E48D0001; Wed, 31 Aug 2022 16:56:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D67AE6B0072 for ; Wed, 31 Aug 2022 16:56:47 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AA87B1407D7 for ; Wed, 31 Aug 2022 20:56:47 +0000 (UTC) X-FDA: 79861096854.13.A8DB0B0 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by imf15.hostedemail.com (Postfix) with ESMTP id 67A88A0037 for ; Wed, 31 Aug 2022 20:56:46 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id e13so18886198wrm.1 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=XP8BpLPgQoYKyMjwItpBKG1yw71NjjE2YANVuFp4bw2uj0/gWO5R89ssaBX6M36Qis vHwXXZhlhgSPIRrevMcM4XB/2oy+7T931lR4V9h8YZrYX5DHhnniE7c7pqw0ugkFMewR zGzADq0PdWucJIPzPN5PP4HFPeE9K/4qcv1XHW5f6t04WXn5xsueEx+nkMTC43TL9Y26 PdHrS3y40IhucF28LyinH6OnlYZfYQfBurAsalzZ83o1zdV3i/S1gfdhkyamz212hBfQ sHrSKUhvc0J2vVIPX1kdxQauak+m3uLNNsoSeUDe56xEhX7uz4GQWBY21/YCso2kUFAC KLkw== X-Gm-Message-State: ACgBeo2Nt6OMdc3nOI2CCHlWZWBGvjr4+ANOFMt8/4nINuNufSk8TC0w /qeBdah5Rij4L3rzK9Tk0creFEobEZNme2/uNLDzSA== X-Google-Smtp-Source: AA6agR7XK78VXHUjktIpBA+ayr5Wvv6QyZC54NZbTQlygRhYLtBkkgViGprvNovg9YVhzd6mrhctznnyhI9ADAmQ4D4= 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" ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=VyP3SbNs; spf=pass (imf15.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661979406; a=rsa-sha256; cv=none; b=G8ZynJ0yz0TbhVbFdo3LlkrIY1u5MnPjshlNXAVDXlzFZgvo/uYtqY4i+Xyo3Tnl9w+974 2cWLud6+EMciRzwqc166aLZMxLzd9u7EpZx4EZnAZCpAcKHPi+uY3ol7Nk7iO2ZoG9DDLI BDGHK1hkmM+Q+SStxtw0XACiub/6ggw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661979406; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q+TlttOrTWNB3q3o6Zbb04N1wsFemMMzZbBDHk1hdbY=; b=MsJsl/ozgsfWlraFv1Ys/ZVURy9YkBiYQsB31TJ7s0lGcBMt5LmoLa1HWn8kY1gQeh40qQ mX04waEWsZ+IzebE66fd5PO0/WYA5FUWa23HYNL7NftpXjnNVLgkKlikjHV7yPCa9qajvo 4rb7WmxkQQxC9fkHNNabvTkyUp+F6eY= Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=VyP3SbNs; spf=pass (imf15.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Stat-Signature: jtu48iadehhps4wcpwi3bhg7ad6c81nd X-Rspamd-Queue-Id: 67A88A0037 X-Rspamd-Server: rspam09 X-HE-Tag: 1661979406-533213 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 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)