Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4750532rdh; Wed, 29 Nov 2023 09:34:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhfb2Hdhi4A1ZPGQbcElq3jjm7JLecYdVpUz7GFl3xIH9iNHLguz2LH4m22nG/QS7UZ4+l X-Received: by 2002:a17:902:be12:b0:1c3:1f0c:fb82 with SMTP id r18-20020a170902be1200b001c31f0cfb82mr19002974pls.41.1701279277664; Wed, 29 Nov 2023 09:34:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701279277; cv=none; d=google.com; s=arc-20160816; b=QDdHIKaWYT869j93B7LkgnapiZve0psyQ4A4Ha2glXe7UeEVaGglT4F4IbndYxpXfU tMHKnC0glF/pQYr/fG1CjFkNM0lVn4rhYOSQ2aOd4iF8e+LcOG6GAIIWyDBuLepE405z fGflvh9chcZ0j462igH9T0h+6MiAgh7IMlgWnhVfYagjK9RC7L8vLczffM2dapDEOXmE JmpTHw2bQuDKXqUiyuLCWtO/MroGBFjWMrj7FPQmJC8f8sWzjImTDi1u8XZCGB4CRlOc u1NXsu4ivqxRknTpYk5yHdcRNZidoJnSycTNyrYaheTs9/sFsZg5SdRFVJjkQhAzwuhg 4TNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=7LZ4hdjEx+/bkD/uGSlKjjH5MTuKqCat3bpSPi4qQDM=; fh=mSkpYRQN8UMCUJ+NhnyPlOolUMxyS9+dw+0YZ4FgwmA=; b=xkqjwD21D+t2lFXZPRevlShuqpyXh8J+nL9C57oyv+Jc0VTMWbTVNXuV9HFvKxSZ1f abzcSbzhmkiPtkpHARXOEo5lGCEU1CXU9d9JYYidktnAIgxuE32JWXzRhqQGaB+0GABA gmn25igwGC5l6MRLRV+RDBEg67IkkGfjXEpzomfuyMzCctLqjOtn0zDOKxC23I3i3n0i u/jNvsDB4ivXgq5ChMAZSASzG+q56qOOjtcBMuxVsQFUDH3LAxMXirNlfRdlhiGW6e02 P7qNOeIVXMLroafq6wZtOxG3R9paj/NVCahb5yhr5xNaTrA4WXEKMwyxrWf8wqQGJR1k b7yA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h9-20020a170902f54900b001d00ff4bf78si2686323plf.50.2023.11.29.09.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:34:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DF1748051A29; Wed, 29 Nov 2023 09:34:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbjK2ReU (ORCPT + 99 others); Wed, 29 Nov 2023 12:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjK2ReT (ORCPT ); Wed, 29 Nov 2023 12:34:19 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D675CA for ; Wed, 29 Nov 2023 09:34:25 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D526C433C7; Wed, 29 Nov 2023 17:34:23 +0000 (UTC) Date: Wed, 29 Nov 2023 12:34:46 -0500 From: Steven Rostedt To: Michal Hocko Cc: Dmitry Rokosov , akpm@linux-foundation.org, mhiramat@kernel.org, hannes@cmpxchg.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, kernel@sberdevices.ru, rockosov@gmail.com, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v3 2/2] mm: memcg: introduce new event to trace shrink_memcg Message-ID: <20231129123446.7d41c4e9@gandalf.local.home> In-Reply-To: References: <20231123193937.11628-1-ddrokosov@salutedevices.com> <20231123193937.11628-3-ddrokosov@salutedevices.com> <20231127113644.btg2xrcpjhq4cdgu@CAB-WSD-L081021> <20231127161637.5eqxk7xjhhyr5tj4@CAB-WSD-L081021> <20231129152057.x7fhbcvwtsmkbdpb@CAB-WSD-L081021> <20231129165752.7r4o3jylbxrj7inb@CAB-WSD-L081021> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:34:35 -0800 (PST) On Wed, 29 Nov 2023 18:10:33 +0100 Michal Hocko wrote: > > > How? You are only reporting the number of reclaimed pages and no > > > reclaimed pages could be not just because of low/min limits but > > > generally because of other reasons. You would need to report also the > > > number of scanned/isolated pages. > > > > > > > From my perspective, if memory control group (memcg) protection > > restrictions occur, we can identify them by the absence of the end() > > pair of begin(). Other reasons will have both tracepoints raised. > > That is not really great way to detect that TBH. Trace events could be > lost and then you simply do not know what has happened. Note, you can detect dropped events. If there's a dropped event, you can ignore the "missing end" from a beginning. You could also make synthetic events that pair an end event with a beginning event (which uses the last begin event found). Synthetic event creation is not affected by dropped events. There's a lot you can to get information with the prospect of dropped events. I would not use that as rationale for not using events. -- Steve