Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1998693rdh; Sat, 25 Nov 2023 09:38:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPzrFlHHDn/zQyLAnFW+cqdGmR4FYE2GNJHMAdDrpTxVbw9G13QyBgRzCNmcRmJ5BytL5n X-Received: by 2002:a05:6a00:1401:b0:68a:5cf8:dac5 with SMTP id l1-20020a056a00140100b0068a5cf8dac5mr7831746pfu.22.1700933897592; Sat, 25 Nov 2023 09:38:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700933897; cv=none; d=google.com; s=arc-20160816; b=HAUywnnI/PTFM3tk0QOObLQnGPIL4LiTdufePTxjG8M5MB4FOJrBFy+hUruZv4QXw2 idMt1lNv8zl8FQY40xHtAwE9169eC32N2Y22ZHnpwD0EYL2m0AMvVR6d1hLnHfc7A1LJ GMsuYdRjuAfXjZzerywhsitP3NtrX8t0Tv5Az8NlzbNZhJ0wVy5/aVSMao0YTIHEMV0j 4XydT7bu+S0nY3cSx+CtcYvASsLNYlylqaNvb5u2DVjCNEiGrAc4pyItv23juvZEA3J+ C1xJMlH0uqgkKTkROWuzcYD3GvXiJEHFWmQH6hpJO+8bkMAR70ZirFj6cMwmbtGbOaU8 bz8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=/OjN2yjM4lGF+xoZzPeOmLggYv6X6PaCmv884vExzhQ=; fh=DljA6aedWyQom500bKqXjVRDdxD4O7idH0HQpQPLjlU=; b=N8u+BQKAc5H6PEsTX2Nqhf7S/6qdIVvOGvvQhpPu1aGdvb4RiiSnRlaQgp0OqXMjH1 0nIFYxtM7AwW85XkUIvLJMGMI2AXWCUQV6RDCCtOElhpXzZKq1FQFrVOTD1mrq9p+wLT jIVm7rOfb9lmKMsW+dCSs7pLRKPIDVeztEEiOKUgTODmjunBpEM6Y0x0G9iTFUVpYV7V pxw73KiT/95F8L5zkNI9Ky+dQhrFf793cU+G3MIaZB8CDj52RbB3an2eJdWMl3iNmYMJ fwpDnBWljLwyvP59VrSBN37OnZAWfTVH8WegZUDqXwLBq1T2tbiFZUtXgfD05gzb38cR GlAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Sb4za/p9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m190-20020a6326c7000000b005c17391f233si6332804pgm.852.2023.11.25.09.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 09:38:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Sb4za/p9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2AF9D8077443; Sat, 25 Nov 2023 09:38:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231199AbjKYRh7 (ORCPT + 99 others); Sat, 25 Nov 2023 12:37:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjKYRh6 (ORCPT ); Sat, 25 Nov 2023 12:37:58 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A696127 for ; Sat, 25 Nov 2023 09:38:05 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-da3dd6a72a7so3501886276.0 for ; Sat, 25 Nov 2023 09:38:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700933884; x=1701538684; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=/OjN2yjM4lGF+xoZzPeOmLggYv6X6PaCmv884vExzhQ=; b=Sb4za/p9PvTD0oIEk6DlS068u8izzt+Sbq6UOPQjqx4DXCVv3RzHfPPtGJvLBf9rEY gx3iWBUNixvRIlAXWhsJqAEWH/lDvJto9kE+a6x9TJTskmY5EDfzR2IFfD3egqbZ8WWY 9vZKRKCQWjUxR2eOC4eKFtWqyYFL6QcpZwKE8lVHFIuhFyboHHyGXplhidwIClLPfVqB DVNX4I/6qtjEZsFqaCERd12IM72HcJxqdb05CIp1TkG5vxAGsXeQT/XWRRrKRAWBpddK hXY29g905eyC4DjR98qVwDL/n+f4BRWMcS840qldcg6y0MGMW2ZlBTuRJLUf/X6SIiwT Gbmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700933884; x=1701538684; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/OjN2yjM4lGF+xoZzPeOmLggYv6X6PaCmv884vExzhQ=; b=F0vwmysKlQ2Y/Xc7uHS0ddpLamcnx9RLkX8CoIy+W4vR/quUzRN9HefVUKFBiN7J5s vPPhB2Ljr9ebu2h14HiKCS2gTQQtTMUu4A7MgPg2OJF0ZMmpcoghSHMqazVjKImEosDL v+jnb+KZmHagrdqav84QbqZXKauWQmls/v9dUax8pxyrgxrro1J6mjqkV5sSG1jXvJGO DC6bOf70sr2ISQHVDQ8izzoAg8m/zt4dtQjfyNoPZvExUYSrxetx29iaCX7D+rl2fSOl i21vLpXoj1jy8itDIMayUI/ss2XM5H+tsxhSPbbr02e88fOsJlPY7jAb+8nJyOngvKn0 /Lhw== X-Gm-Message-State: AOJu0Yw/yOPEjCEm+KJNmRzM2xU8Pxlr4A2/zE4pD+7A1ozvu5dzn6zh VjtU+MYEBXrbn+Hp/Gd7KO+omXfEttnMSg== X-Received: from shakeelb.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:262e]) (user=shakeelb job=sendgmr) by 2002:a25:3d44:0:b0:da0:567d:f819 with SMTP id k65-20020a253d44000000b00da0567df819mr220022yba.10.1700933884073; Sat, 25 Nov 2023 09:38:04 -0800 (PST) Date: Sat, 25 Nov 2023 17:38:02 +0000 In-Reply-To: <20231125080137.2fhmi4374yxqjyix@CAB-WSD-L081021> Mime-Version: 1.0 References: <20231123193937.11628-1-ddrokosov@salutedevices.com> <20231123193937.11628-3-ddrokosov@salutedevices.com> <20231125063616.dex3kh3ea43ceyu3@google.com> <20231125080137.2fhmi4374yxqjyix@CAB-WSD-L081021> Message-ID: <20231125173802.pfhalf27kxk3wavy@google.com> Subject: Re: [PATCH v3 2/2] mm: memcg: introduce new event to trace shrink_memcg From: Shakeel Butt To: Dmitry Rokosov Cc: rostedt@goodmis.org, mhiramat@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, muchun.song@linux.dev, mhocko@suse.com, akpm@linux-foundation.org, kernel@sberdevices.ru, rockosov@gmail.com, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Sat, 25 Nov 2023 09:38:15 -0800 (PST) On Sat, Nov 25, 2023 at 11:01:37AM +0300, Dmitry Rokosov wrote: [...] > > > + trace_mm_vmscan_memcg_shrink_begin(sc->order, > > > + sc->gfp_mask, > > > + memcg); > > > + > > > > If you place the start of the trace here, you may have only the begin > > trace for memcgs whose usage are below their min or low limits. Is that > > fine? Otherwise you can put it just before shrink_lruvec() call. > > > > From my point of view, it's fine. For situations like the one you > described, when we only see the begin() tracepoint raised without the > end(), we understand that reclaim requests are being made but cannot be > satisfied due to certain conditions within memcg (such as limits). > > There may be some spam tracepoints in the trace pipe, which is a disadvantage > of this approach. > > How important do you think it is to understand such situations? Or do > you suggest moving the begin() tracepoint after the memcg limits checks > and don't care about it? > I was mainly wondering if that is intentional. It seems like you as first user of this trace has a need to know that a reclaim for a given memcg was triggered but due to min/low limits no reclaim was done. This is a totally reasonable use-case.