From patchwork Sat Oct 26 00:48:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JP Kobryn X-Patchwork-Id: 13852000 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 03A11D149F9 for ; Sat, 26 Oct 2024 00:48:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 846536B00AC; Fri, 25 Oct 2024 20:48:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A7EF6B00B0; Fri, 25 Oct 2024 20:48:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 620366B00B2; Fri, 25 Oct 2024 20:48:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 470CF6B00AC for ; Fri, 25 Oct 2024 20:48:39 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CE894141387 for ; Sat, 26 Oct 2024 00:48:17 +0000 (UTC) X-FDA: 82713917034.08.690139F Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf02.hostedemail.com (Postfix) with ESMTP id 7CE1180006 for ; Sat, 26 Oct 2024 00:47:58 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SQvK4qwD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of inwardvessel@gmail.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=inwardvessel@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729903676; a=rsa-sha256; cv=none; b=rnnhf/NwPF/xC8Tc4QkqGN+/hP/e819kjRON1W+QLbcbzYyW4pbc67XJc7aP9/9XYu524u gi0Cf7HEm0d1nQDz7/QEez/T/7l5o/Og7vHvhjrkCFzhENIh6MfpNa64698oTeux7XWP+K SeBSpTEVFSAL6qX9lpCY2EDJI1IjJ1g= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SQvK4qwD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of inwardvessel@gmail.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=inwardvessel@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729903676; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7fA7WcO3E5pEDm+0LOtfHSLJ9cdNF7fPH0isXm9fWCU=; b=5sAElnV7a2cB9iDbtElNw6U2iUcepCKIC++W5anSvE5zTFad92eHAz5UCe71sGiWDat61O jIiThLfphnXu0mppWwP1CuxJx2EKH06vKbxkWK22WXXGuWjBiFyICpLUJY7LCdN9j6E1Aq UOYFzFtjijufjeDEfZEBccQkqi11vfA= Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2e2dc61bc41so1877271a91.1 for ; Fri, 25 Oct 2024 17:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729903716; x=1730508516; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7fA7WcO3E5pEDm+0LOtfHSLJ9cdNF7fPH0isXm9fWCU=; b=SQvK4qwDoLoPnvjp5AT+3mUOr+krHOYmFXp4uPTkV8QnkPBlmQDqezhHf4Hna/psw3 WbbEaSCqxBvrAi3BAsee2Wq4d+lA9bY844cHFznQN3dFs1TCO9XjMWL5ohXeHkrYJ6YX YdqXJ1Wb60K6L46DRZXI4JTnYtxN3g1vgFexggfUz2DHWDYYCdqE1E3TcSQHm08faQdi e57DP6ggjrOv/J4avNEcCTZg6mgbKAFzVwwSQ/sa16dEGQi+LFzbqYQ9YQcZJsbe+eiW CQEgbc8BZWMWzwTYeO+A0KpQ4I+qcrIyAfb7dvTifH63QJvrPUXVCIv0tCSRwbuH9k4V vLTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729903716; x=1730508516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7fA7WcO3E5pEDm+0LOtfHSLJ9cdNF7fPH0isXm9fWCU=; b=UEDuc6jHe1jcxupbfLtxMKvtAl4lUPLVFUuJDQGjAQOfZ6KFBWaldFBNjt2qM5AX8O LnqbcKYaRRRIoOliKXigE2e6X5SSgDc2KrMnhTiec0AqnfJTLJP2r23vfoDTMdJ6uo8I FW1mPu+TGSuS/W8pwYfK3tJ5sz+Ud0grtgeIm1pjWweMlXSe3LT8NlYD1cVp9Tu9H+Og eAqAMH7icmydHxWirwIToQdVcMbS8ruWeKCOZPXyHADrT5cnJarXsAEbJkW3qXXoDaM/ mZDZTxxC3jb7iycAw4ix7eX1TP8mWqnZgBTD/2tTpPxpAHDCLf939HsoEn0r83dEJ3Yu pgHA== X-Gm-Message-State: AOJu0YzCvsDLvCg1wEEtmeHTg06VSDKu8e2Kq2nCT8GIR5xL5q4oVly2 uy1k8KDCOhzkfxcK1GJLL6NoMsxghQbZjEbtyZP+vK/1WCtjRAbk X-Google-Smtp-Source: AGHT+IG8s6V1enHwWFRipM3OcTqSi0KNhyZtfDNk2LRJn8DilFz1SDop76Gqj2Wixr8/K7JkamzbeQ== X-Received: by 2002:a17:90b:5201:b0:2e7:6e84:a854 with SMTP id 98e67ed59e1d1-2e8f0f53e17mr1650825a91.1.1729903716025; Fri, 25 Oct 2024 17:48:36 -0700 (PDT) Received: from saturn.. (c-67-188-127-15.hsd1.ca.comcast.net. [67.188.127.15]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e77e48ad66sm4249738a91.4.2024.10.25.17.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 17:48:35 -0700 (PDT) From: JP Kobryn To: shakeel.butt@linux.dev, hannes@cmpxchg.org, yosryahmed@google.com, akpm@linux-foundation.org, rostedt@goodmis.org Cc: linux-mm@kvack.org, cgroups@vger.kernel.org Subject: [PATCH 1/2 v2] memcg: add memcg flush tracepoint event Date: Fri, 25 Oct 2024 17:48:25 -0700 Message-ID: <20241026004826.55351-2-inwardvessel@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241026004826.55351-1-inwardvessel@gmail.com> References: <20241026004826.55351-1-inwardvessel@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: u31ez7q49587qca5bezee5w19qjd51sb X-Rspamd-Queue-Id: 7CE1180006 X-Rspamd-Server: rspam02 X-HE-Tag: 1729903678-144549 X-HE-Meta: U2FsdGVkX18CCxQi1j2vOOBYMn5z9rPaxzxxHodoEiu1v4Hvh3cBMPZI4vgfddZ1jA0JVg1VkWUK75/raA3FXEkOgZDLdDgX7p8Lb8PEXFDNLnK9YmxHS9wtxrj6ah9FKEnuTGA5C558KFZSed5LadFMGOK0+bWEQLiCv59h5Z1exayVqEKyGQ97V9POyMLBqY1FaoUvBARBXMGkaCvingtu7eb3VUUYpOoBt+cMPgl8SeBSfLVZCPa6dWPiDajug/m+tDZA4ee2TdnY+aUmLOflDxm/marpGTPCKY5wV0wBoaxu1hrHf9kU5bu5vVb4uVssd/3qaIaOB6CBhCRLmv38+q+JAyLi93vOJle6VC0bhDlD3mp/nzlieCHwDQpYReHg1kquMvNKllPvD3C97E8JZOsNoW9BWzy4blEMmdq9J2RVeAYxU4brV+V2PVnN02w98FJohvacPWnGboriuqy9kNg+H2vP7LO8V/v9sj5A4rmVPJbtjAutjDoRT5Bl9ekDYu+NMWI0B+Yi/XAOYJGrHzhEVA9MVqymtQjfVhJKjM7qTkTWHWZjbhw0jt8Not3dXk3s5dS7OXt37hyhOFbmYi32fixUK1X1YbQQBrMxgOPamxTVLL0d/xJzYuKCZuwGx9Uik0G9brNx/i10UqEvx/aRaok1TcadyN1EHwBWmZYccZ8ZrA8Cl8HgRMmDRk/u8KOGsVQXMciAh9oaz6rbx3rQCsmise6xs+hoF266YC4cHvnw57wmEhM4KSL49N7nkj6j0UgDRfdyryiNp5y1WK4A1vG4hTp7iEcQLFFJXPD+T1nxdkYKGkCLbYZJ92M9rdFZbgPLkQUFebvnvEJAepb1ezuZfhmuNQ5NPcBTYvYmNuXPlRDxyjLk36gUvMY1MZqMWAsH0cAwTE+hyPig9O4oQedHECBXSYYz94/9jKVv99B8zNEaOUvAKtQClaxcgjKueDOj4hv+JL0 wdmVhtyO 5yG9XdR84uYO6LO+rrcK+X6GOp50wpKp7qotIWOM+cCZdaMP5+4HfxaXu6fKCwilbeNXNfBO5AOhVxLM42L9k2GsgjrFVpW1cZv3/KEec5GBVCSgqd3QxLqD43Wk8LH8nifTmczdT/VpQfyl9HbYkUrjmfrh9TE9c0QGVE9yY3FaWJ9LG9847hL3ewPMfqeLvHxg6BaLeeIxLCwyr6KhjilzR2ul9UrFNN7WYcLQu2OhCcWOWAUV0BfVt8xd4h72e6QGBfs3O6i1GnHyFqPnr1XOL5l8vd+S6qij9/eyi3DsRQoDpg50ElKX7YI7d7OYU4AsjNELKkmKT4DC+BWiPPvFpYsBC/yHQdhTWnTVB1pVUsQyoB8oy3yUqGQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000718, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This is a tracepoint event that contains the memcg pointer and information on whether the flush was forced, skipped, and the number of stats updated. Signed-off-by: JP Kobryn --- include/trace/events/memcg.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/trace/events/memcg.h b/include/trace/events/memcg.h index 8667e57816d2..dfe2f51019b4 100644 --- a/include/trace/events/memcg.h +++ b/include/trace/events/memcg.h @@ -74,6 +74,31 @@ DEFINE_EVENT(memcg_rstat_events, count_memcg_events, TP_ARGS(memcg, item, val) ); +TRACE_EVENT(memcg_flush_stats, + + TP_PROTO(struct mem_cgroup *memcg, s64 stats_updates, + bool force, bool needs_flush), + + TP_ARGS(memcg, stats_updates, force, needs_flush), + + TP_STRUCT__entry( + __field(u64, id) + __field(s64, stats_updates) + __field(bool, force) + __field(bool, needs_flush) + ), + + TP_fast_assign( + __entry->id = cgroup_id(memcg->css.cgroup); + __entry->stats_updates = stats_updates; + __entry->force = force; + __entry->needs_flush = needs_flush; + ), + + TP_printk("memcg_id=%llu stats_updates=%lld force=%d needs_flush=%d", + __entry->id, __entry->stats_updates, + __entry->force, __entry->needs_flush) +); #endif /* _TRACE_MEMCG_H */