Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp174303rdh; Thu, 23 Nov 2023 00:03:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzQTyq0VWzedyby9zXDOrtk2GbUWwyCggfGk0nsi5U6ALRBfY4iXIMYDraurxbYKtv+sk9 X-Received: by 2002:a05:6a00:278c:b0:691:2d4:2389 with SMTP id bd12-20020a056a00278c00b0069102d42389mr4443617pfb.21.1700726635528; Thu, 23 Nov 2023 00:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726635; cv=none; d=google.com; s=arc-20160816; b=EMCvXFeKkfTaNk/+5Sajpnm2VcIM1Jb7VEtgGwvWTpCeP5FKvD01r7X0pfo75+k6y9 wKq4bjW9rR0kH7FhzxxdTvdJAiKTvkKXRmF4oQJsQkpReGDA1pkfNDmmrEMMm06HGZhE cZoBgkXv05kJK8+2F2r3QomBpKYMur3hubfe0O1zNUHTKyobFX/YvWzn7UyzAVUUJI0F Y+J7D1l2PBtZfInvfzKp9k3QBqxETbWAZiRV6/hbZjb4Xm4So9n+p8HtsxdDKYefJeYa Mpg7z1QWp32dkP/1cbHuP4tWbSCiL/qaIkCjwOgG5OsypOTlR/Hr00AshmVadVZNpqC3 Pmmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=lKtCLctmBBF1Tsb0SyxySTIx7meumO6usFrm+TS9QSU=; fh=+S6jYKQofpqFY3GIqSLJSt8+bEIrqANTNVz3XlYQPHY=; b=PdHqLRK9v22jijTjFjSh8xy6K75Cgv/1t1q4OP+aFEuH4dd+VV5HoaE+0L6tNM0xEu TOOAqtCej3n9IA/vzlSzfCWg/Z4B2Bpu2IIR4gkUVDoaJOdPxJF9hNNX9BVK2XRrK2vp Eqcf+/wtgGs8eRigm7S7cBH8yr0wVe+fGc7Ih0atWKyZrf+Ib73VmrnCOvXSfZzu5Q3a 3D+bFLN1muHfJHZw7/Vln75c6YXGGoIRNY6Hs2PDR6tgxkyGD/A2PaHKZUbbtPlHWNDh RbzKmzzQoRM1jOlSZMfMHO5G+ZzmmlLKZ1mEGaQeZZHk9vV2nWUb4d6z9XihYUYRkZed lYNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=D4HCV6dF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id t9-20020a056a0021c900b006b6cc63a79csi801228pfj.330.2023.11.23.00.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:03:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=D4HCV6dF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1149C807E467; Thu, 23 Nov 2023 00:03:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231744AbjKWIDd (ORCPT + 99 others); Thu, 23 Nov 2023 03:03:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjKWIDc (ORCPT ); Thu, 23 Nov 2023 03:03:32 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F40921B3; Thu, 23 Nov 2023 00:03:36 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 967F710004A; Thu, 23 Nov 2023 11:03:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 967F710004A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700726615; bh=lKtCLctmBBF1Tsb0SyxySTIx7meumO6usFrm+TS9QSU=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:From; b=D4HCV6dFilbsWayXzzkcs2T3NjL+YalHW9kY4+EXk8KX8O8DVINwNEMKhE1m/Jt98 DFKEZnQ4TuySorJZWAqyH1hva8f0bl7O9vE7Qobb20zuD5INDosOQ8b6FUcIm1TJVa rqCJkqK806c8WyR57ONIIyCGuDreWGDfE5pNIja7xaaOCJh4ILZThAhJZS3Pil9V4Z AA6YMS1B0yvlB78T7At+bPtUp3CwF5FV/0XNuk7eSKgGdrRrhhbRHFOYVRN/rpkXQg JUngGqB34jZ319nISBEcC0l987OrKgiz/G5uG8DyLXmESFsMBxH6r5fiH4briEGsjR s/jlm5GYwRLoA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Thu, 23 Nov 2023 11:03:34 +0300 (MSK) Received: from localhost (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 23 Nov 2023 11:03:34 +0300 Date: Thu, 23 Nov 2023 11:03:34 +0300 From: Dmitry Rokosov To: Shakeel Butt CC: , , , , , , , , , , , , Subject: Re: [PATCH v2 1/2] mm: memcg: print out cgroup name in the memcg tracepoints Message-ID: <20231123080334.5owfpg7zl4nzeh4t@CAB-WSD-L081021> References: <20231122100156.6568-1-ddrokosov@salutedevices.com> <20231122100156.6568-2-ddrokosov@salutedevices.com> <20231123072126.jpukmc6rqmzckdw2@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231123072126.jpukmc6rqmzckdw2@google.com> User-Agent: NeoMutt/20220415 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181550 [Nov 23 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Track_E25351}, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/23 06:37:00 #22507858 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 00:03:47 -0800 (PST) Hello Shakeel, Thank you for quick review! Please find my thoughts below. On Thu, Nov 23, 2023 at 07:21:26AM +0000, Shakeel Butt wrote: > On Wed, Nov 22, 2023 at 01:01:55PM +0300, Dmitry Rokosov wrote: > > Sometimes it is necessary to understand in which memcg tracepoint event > > occurred. The function cgroup_name() is a useful tool for this purpose. > > To integrate cgroup_name() into the existing memcg tracepoints, this > > patch introduces a new tracepoint template for the begin() and end() > > events, utilizing static __array() to store the cgroup name. > > > > Signed-off-by: Dmitry Rokosov > > --- > > include/trace/events/vmscan.h | 77 +++++++++++++++++++++++++++++------ > > mm/vmscan.c | 10 ++--- > > 2 files changed, 70 insertions(+), 17 deletions(-) > > > > diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h > > index d2123dd960d5..9b49cd120ae9 100644 > > --- a/include/trace/events/vmscan.h > > +++ b/include/trace/events/vmscan.h > > @@ -141,19 +141,47 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_b > > ); > > > > #ifdef CONFIG_MEMCG > > -DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, > > > > - TP_PROTO(int order, gfp_t gfp_flags), > > +DECLARE_EVENT_CLASS(mm_vmscan_memcg_reclaim_begin_template, > > > > - TP_ARGS(order, gfp_flags) > > + TP_PROTO(int order, gfp_t gfp_flags, const struct mem_cgroup *memcg), > > + > > + TP_ARGS(order, gfp_flags, memcg), > > + > > + TP_STRUCT__entry( > > + __field(int, order) > > + __field(unsigned long, gfp_flags) > > + __array(char, name, NAME_MAX + 1) > > + ), > > + > > + TP_fast_assign( > > + __entry->order = order; > > + __entry->gfp_flags = (__force unsigned long)gfp_flags; > > + cgroup_name(memcg->css.cgroup, > > + __entry->name, > > + sizeof(__entry->name)); > > Any reason not to use cgroup_ino? cgroup_name may conflict and be > ambiguous. I actually didn't consider it, as the cgroup name serves as a clear tag for filtering the appropriate cgroup in the entire trace file. However, you are correct that there might be conflicts with cgroup names. Therefore, it might be better to display both tags: ino and name. What do you think on this? -- Thank you, Dmitry