Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1096825rdb; Wed, 1 Nov 2023 11:08:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiOkMTyNC2mJOtvuuSQICkwamJVVvECkSHXp4NEK2jM4IW2cZlJlMonz4kSqgw7nkQZwZX X-Received: by 2002:a05:6359:d1d:b0:168:d0a3:202f with SMTP id gp29-20020a0563590d1d00b00168d0a3202fmr16843566rwb.15.1698862104345; Wed, 01 Nov 2023 11:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698862104; cv=none; d=google.com; s=arc-20160816; b=KCCt2VzGE6+dZjcYquCpw5kIsFLiDupimluQjXSvrQIs206IY0GRHByUOO0AOdPut/ qevUMINcyJsGKlk6262b/T8js8ihnhw/F9leRl2NNWWZJDk5DujNdxaEFlAfRDBWBbRD vRi3nsJVTHzUu6TFq7j0bekxnxDzbEV0EOO6aZSMdiMDKA3YDUQaR0AMTo5eOFQfWKgc D2zHFr4gOEfW9ovMWFmQNfaNRzItj1OGYYZUG/cr/PDVsf6o96cpblt4hsPp+0LCLVOY QJH7faAHF4GCSxbYWxa1BqxhqeUt+xPN2IDXejOnWtfsLbR4BwyulwFlottcVnqAcM9A wdVA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-filter; bh=NKk0Ei5MZui3Aywy6eGW1GkpmW3iDmxKvWin8MaGXgg=; fh=H9Mr4qRbcaUPPvxg1B3WqXxbk3yGpMVUsiv6omSTLDg=; b=KBD8fUJ8f/kyo54DQQUkrQ3drBuhkgMc1dbwUrhr081VwmFLSmB0wM/2y81TihCEQU 9iP0y2G7p3uDuIsMG+kp/NN3li/d0qbu58g8iD2RUrEMKHM2lE15ILyU1p4FMpSjnF9Q iprauD2DFb2U9i3VOSNhoApiGspOvlOr9N8V2GuGMACDhlZ6vrixvilBZ2SS840AxB9U 5CYqmdFtXolU+Qyu7aGe8TXZRNzrXADbRsaBF1bv7vieWdzL6WLCvGcIi45CwblPw60M ewvZh4gBOLNaktX40cT2YZH5tvg2EewGclOt3YXsZCnmPiYX1G0KhLqe+jwUkKlT8OYO x28A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Tcn4RcdV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ca3-20020a056a02068300b005b8f446408dsi387167pgb.449.2023.11.01.11.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 11:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Tcn4RcdV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id D24E9818F6AE; Wed, 1 Nov 2023 11:08:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344941AbjKASHx (ORCPT + 99 others); Wed, 1 Nov 2023 14:07:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344924AbjKASHw (ORCPT ); Wed, 1 Nov 2023 14:07:52 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C362219D; Wed, 1 Nov 2023 11:07:40 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 67E1A10002D; Wed, 1 Nov 2023 21:07:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 67E1A10002D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698862059; bh=NKk0Ei5MZui3Aywy6eGW1GkpmW3iDmxKvWin8MaGXgg=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:From; b=Tcn4RcdV/HCxG/U9qbWo8mJj96iMrkRvfvy9pXkpfIJ8F5Geon8pTIer16QyOkYL+ KKHr+w4rEIKxD4ssopU5w63z7o5YUaEF6b94Z10ugkixJmJvBDKemr2omtYu/z9Mfr UifDNCKg3i0TrmVR0NYCNWpfnrUUCbJW65mDCCW3/FTZz7aP5NeMAMWcQkfVSejAEF PitoFOCAeY6qpl0s1R7O3971tCX2RSkqdGxx8K13qG/JKQqJAdKlhGjAoYmX9IAKUt TbjrNfwTn785fQPN9VUL0p8zPMiEuvkazRb4iVrYmAa9wFavZr4f6dsz90biw3Teer lBI9Ermt4DOqw== 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; Wed, 1 Nov 2023 21:07:39 +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.37; Wed, 1 Nov 2023 21:07:39 +0300 Date: Wed, 1 Nov 2023 21:07:33 +0300 From: Dmitry Rokosov To: Michal =?utf-8?Q?Koutn=C3=BD?= CC: , , , , , , , , , , , Subject: Re: [PATCH v1] tools/cgroup: introduce cgroup v2 memory.events listener Message-ID: <20231101180733.ok7j34izehrpyfpy@CAB-WSD-L081021> References: <20231013184107.28734-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: 181058 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Track_E25351}, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2, 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/01 17:32:00 #22380453 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 11:08:06 -0700 (PDT) Hello Michal, Thank you for the feedback! On Wed, Nov 01, 2023 at 04:56:47PM +0100, Michal Koutný wrote: > Hi. > > I think the tools/cgroup/cgroup_event_listener.c was useful in the past > to demonstrate the non-traditional API of cgroup.event_control with FDs > passing left and right. > > > On Fri, Oct 13, 2023 at 09:41:07PM +0300, Dmitry Rokosov wrote: > > This is a simple listener for memory events that handles counter > > changes in runtime. It can be set up for a specific memory cgroup v2. > > Event files on v2 are based on more standard poll or inotify APIs so > they don't need such a (cgroup specific) demo. Additionally, the demo > program lists individual events, so it'd be a maintenance burden to keep > them in sync with the kernel implementation. From my perspective, eventfd serves as the standard mechanism as well. Therefore, when incorporating the cgroup v1 event listener test into my project, I initially turned to the tools example, which proved to be immensely beneficial. Conversely, the cgroup v2 inotify example can solely be found within the kernel selftests. Although the prevalence of inotify makes this somewhat understandable, having an additional example would provide supplementary documentation, which is often invaluable to developers operating in userspace. Of course, there are maintenance expenses associated with this approach, as you rightly pointed out. However, I am willing to undertake the responsibility of maintaining this example if necessary. -- Thank you, Dmitry