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 50FEAD11718 for ; Fri, 25 Oct 2024 07:41:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF9D46B007B; Fri, 25 Oct 2024 03:41:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA98A6B0085; Fri, 25 Oct 2024 03:41:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C71586B0088; Fri, 25 Oct 2024 03:41:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A83106B007B for ; Fri, 25 Oct 2024 03:41:25 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 306D416058B for ; Fri, 25 Oct 2024 07:41:03 +0000 (UTC) X-FDA: 82711328616.06.2D497B2 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf10.hostedemail.com (Postfix) with ESMTP id C1560C0013 for ; Fri, 25 Oct 2024 07:41:14 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=wMvhkliU; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=yosryahmed@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729841913; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AiFj6HMw0y/O5aggx5/oK92kDrhsx1ofZsrKfgYwmio=; b=5T+UdUIb+9jH5Okm5hTYlKui0TjW0w3cEGZymKhCSTKqKLsyG4buq5biYx3mQxpLJSmWOA PjQ0Kx2Lw49i8Fo/GQo2icSbXidktxs6h+Hf6c4lhJLmBLXhTJb3aeuG2HBQuYJleLU5zo uQ0oc2Z+Sz7wUOMaj+m7HyDGtt53180= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729841913; a=rsa-sha256; cv=none; b=GPqfRSLbKLPdr7TpjkooE4AQf+90wQu6238FX6bsUOdJCzD9LfslGSWyBUi1LSBw0rQ01F LR7dSwS9JIE1hk9PZdARIg2rQ7by6lT7U66bKzvo/LmLNetcy6k0749nfxvS/lgBPjcABG +cm+82R+e0BSFL4AU+MLyROnQlZHOx0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=wMvhkliU; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=yosryahmed@google.com Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a9acafdb745so333781066b.0 for ; Fri, 25 Oct 2024 00:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729842082; x=1730446882; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AiFj6HMw0y/O5aggx5/oK92kDrhsx1ofZsrKfgYwmio=; b=wMvhkliUguEC4HLjYt4k3YUpZZKUl65RKRqf6HW9Zvef05tx2JHfWsEnypS77QlxP5 n7I7X4y8Y/omZrn0DLaPvtYdCrfgiPysKKuIHetCh0cj7F9WVu/f7L7TKaUGEf4n4RAo gUs0Mxg6v6Q5sX8bvq8Ke1Y1p0lsQTkOAL1sJka5zGR4bjLEoPwPajafsmhkoY8kG/H5 BSXe55UbFxYG+VWdw4FyUNBg+CGg90TKhLelsPnpe014uVnGuYdRGFdOpUpNU4Rzo3m+ w4K7Qu0DnVGoCz7BfwI6ORue5sFN1ZXWiWXFtvDjc1J21b/eW9wNPJP0tC6tPS6gXJnd vIHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729842082; x=1730446882; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AiFj6HMw0y/O5aggx5/oK92kDrhsx1ofZsrKfgYwmio=; b=up/gx7iUWrDsVT68NmZRzZMS8QXqRQyyLclxm4xaMIDcdCVd+2BgUudwqb/5w8tn/6 haSLZI0Y9I8eFfO+oTi7GxFu3Z2akCFM/JN6ehGTNLt/qsfgmMEIDRuRNE6Lh/mTrBdr ohPku3H009aHQImzl0l9Wixgka634BRLmDlICxFRhNUkjPt9gY2rRhWKcRUUyiXM7bVq FD76ChNY9uo5fs+XGRI+ToNLoXufLQK63Nq/CpG0SKL7euklIP3ri2tJsgTmAdCh1irC QOj0hmprFFejJBcSJ4uYG9hKi8JbDAImLJJaqF6iGso6YILJxheyJS1nrTFLXDEASK5X PztA== X-Forwarded-Encrypted: i=1; AJvYcCX+Uq1l406s9+R3CNO1MXe6K40e1jDGQI9LIqOqGblmoIlWrkxmTJ8t+YoR20TXcRyihnfrLmhauQ==@kvack.org X-Gm-Message-State: AOJu0Yx91vjVVU/w15pOp4VoqToyxyvVL8Wl2Lpt7NrhtdEuDb/mJxWc whk/p1UPnzBRNl+Adq6USBPzsnNBBItkHXNt88dAnnRh9HpLJ7paR38NXSxHvFC7SHHcU44mJdq fezGnyywM5+uhOeWqdNeKM2z+nsSZWk0NoUrQ X-Google-Smtp-Source: AGHT+IH5aRnkOHWC5g1Il1wQQtRvZd/XkZ6q+mhHsKeIe3heNWwjIkZHInx3cnk7oLTlMqdXaMEy0uk/Pc9VvCjZR+M= X-Received: by 2002:a17:907:3d89:b0:a9a:eeb:b26a with SMTP id a640c23a62f3a-a9ad199c380mr466230966b.1.1729842081325; Fri, 25 Oct 2024 00:41:21 -0700 (PDT) MIME-Version: 1.0 References: <20241025002511.129899-1-inwardvessel@gmail.com> <20241025002511.129899-3-inwardvessel@gmail.com> In-Reply-To: From: Yosry Ahmed Date: Fri, 25 Oct 2024 00:40:45 -0700 Message-ID: Subject: Re: [PATCH 2/2] memcg: use memcg flush tracepoint To: Shakeel Butt Cc: JP Kobryn , hannes@cmpxchg.org, akpm@linux-foundation.org, rostedt@goodmis.org, linux-mm@kvack.org, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C1560C0013 X-Stat-Signature: ttoydbmbanoq4dk9wm7fznugzohii6iz X-Rspam-User: X-HE-Tag: 1729842074-63195 X-HE-Meta: U2FsdGVkX18n95o52j3Utlq7hTwx2VnnITgnA9xN3u3Pi1+gtghjeBODmFq3tTtbuBTP/5BzsjtEaBl6vUCg+b/Es5JQjRLqi8n600gXModQmjyka7rBKoyqta595fLBv2kFkinme+yLPLntL8lM+jkoL2lKeRLERJXe2bV6qhSt2SyqyhNen1AIAhBcfZsOOY9EGouKFvlUsUifNbeZ5psJdmhTuleVEltRaPR2hemt4p+GOEx1ztwVPVo86VeyUnhgPeBNd6XQZvru0mPRqBG+U38pCc34b8WLRWXfDEG0e5cn5laEAwWuhpo7N2zyAfBBV9AKzqQSOMTJgCN0QmxkH5UhN6fJF7/ise259uOX2ZBJImZ6GOiZ0RyO9a7ZS1kEAHhXBkvp1byY/JvO+u/XlfUr3hsDiCZAKD6mhYo7BME4SPNPHlMO2vea1exq/5fEdbMVZTG+zakYP9yNoQKyDtXp62HiZqZWT4Jeukdwnqp2BCxYJmcGs1C+3IhzBrSJdcI+N2GMpoLrfsD+89/TFyXHpza31am0SUmEKXSR/Yyl6XcwCFy3EHWooBqzsGrcgOF346XIu2WfXJuh27t2OkgKPf8Cv9XlCIxykNVopi+xlrXgF25LpNoyNOC0i1pum3b0vKtQWe3V6qoJK+WFRJiDpT14RN5T/Qxblap34rD8E0bSmmXm9sLV7T5eZQ0gIuxGr4ZRx8/5Gryp6vDz1cFn2dR9KHx2MGleXHmu2TDynMgvIIUXEaCs7yZplKwq08Xj507cDnhLs3IcqxIGDoUgbst39g2+E3yMU2UTHtjmbBNF46oAaKhtaIrabVWIsrfEmbTp6j9FfMOVP7Faq4n5gXhKRxa11NYz6n1d8K34Mi+HVSWLnbKxdeYeXfNibsLCI5D2vDP/5u6dPKaRntD2bbCZKAiaADjkQljvXksdAuhTvik7HprvzEjUy59oOnKd0IIHkA9NtEP oeD6id1h 5go4Hw1leXPuDPQQYxwGz0lWxvTj/sHUcwRFXaIP3t7INCjF2sMMS71gESsT6lR9xJKPxQczCRqo1QPxhQmkRdIvxtqylCHLLouCOZfiN4jWwhfkDylAGjVU1QG0NtfpoDH8Vkr+dgp9fNqeOKmfMcQB9CVXIrjpZQjljP3P11sKo65Ya15znfsEhuXlLEsutRLVfbLJc8MUSguqUHk3dQ/MmPA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.009624, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Oct 24, 2024 at 6:16=E2=80=AFPM Shakeel Butt wrote: > > On Thu, Oct 24, 2024 at 05:57:25PM GMT, Yosry Ahmed wrote: > > On Thu, Oct 24, 2024 at 5:26=E2=80=AFPM JP Kobryn wrote: > > > > > > Make use of the flush tracepoint within memcontrol. > > > > > > Signed-off-by: JP Kobryn > > > > Is the intention to use tools like bpftrace to analyze where we flush > > the most? In this case, why can't we just attach to the fentry of > > do_flush_stats() and use the stack trace to find the path? > > > > We can also attach to mem_cgroup_flush_stats(), and the difference in > > counts between the two will be the number of skipped flushes. > > > > All these functions can get inlined and then we can not really attach > easily. We can somehow find the offset in the inlined places and try to > use kprobe but it is prohibitive when have to do for multiple kernels > built with fdo/bolt. > > Please note that tracepoints are not really API, so we can remove them > in future if we see no usage for them. That's fair, but can we just add two tracepoints? This seems enough to collect necessary data, and prevent proliferation of tracepoints and the addition of the enum. I am thinking one in mem_cgroup_flush_stats() and one in do_flush_stats(), e.g. trace_mem_cgroup_flush_stats() and trace_do_flush_stats(). Although the name of the latter is too generic, maybe we should rename the function first to add mem_cgroup_* or memcg_*. WDYT?