Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1368982rdh; Mon, 25 Sep 2023 10:31:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBSZANj4Xx+oGQ6ts+Z7k++JKna3IkNW6Yc01Sgfa4RoGaVzXd1fzCI1KWT4cxgy8hpE4Y X-Received: by 2002:aca:1104:0:b0:3a0:3495:c8d4 with SMTP id 4-20020aca1104000000b003a03495c8d4mr9182437oir.28.1695663060928; Mon, 25 Sep 2023 10:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695663060; cv=none; d=google.com; s=arc-20160816; b=JK819gh6LKNy3ERool9/N88nDR1R0avkguw7mu5GrJCw2m2K5kJXHWZAUdAw0FBawS NMki0HDEgRAeT/oeTiwVXPObxzzJCrd2X9vEkRr3PyuSCCQpsahgJaH+Wtl9ruqFzgp6 xOIzjMULlEoVNW2mVsV1+WMjdYOEBEGwu9E4vdKwE5Jduf9ShIZrEwhqs8NO/AGsLCHY HN84d6ajdbgjbVv/2VA0gkKnpY2qhKhrZ3VTBeRDwpe+DWNF8kQWWYPzT7Yvk9qZuJAM Zm9I0woSMifKe1LgMUa0rprQ5UNr2cS7xxNAC954PGjYhk1jOYWkeKiLrsqAkL+GzOkD kuuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=/TClsZXVGXCV9uINJx9IgXVRoHxhac9DAEBNZbscd1w=; fh=0HHSsPdVYGOSj7TH29QDeyTUptQ5JiubdxSjoWfG9yQ=; b=QgeDh/vL/71qPqkb/Yyo9Yky+bLWwXmWQPa+oN4RW40Xb1Idd89tmHc4rkRZnyamIA 4HU7DuN1X8mzL3sGmEnFGpBfScupr4uDmn9s1OKTWOOIApeHZvRRqqcFPu457YqtmCfi FUye74n+Y+iKuZCJFcabzAlHk+RVrkcSfXCiF9P3cljVEB9gx0/CZSgFBbNgdOabeb9W +KRmECkmZqiySClfOYVb+lfCe8HZ8y5sMwhlcsnvllFaD79RjHpTRdyvX3vgP0F9F7WH ZAeDZ3jJKf6sraClp5I29pGHNxGF1ZMwkPzgc6UmJJVsYs8TQDC7Vb4+5XZp5ryRyxPS oELg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WBNUXt/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x17-20020a056a00271100b0068a5752a049si9927908pfv.96.2023.09.25.10.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:31:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WBNUXt/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BD9E38061383; Mon, 25 Sep 2023 09:57:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232402AbjIYQ5d (ORCPT + 99 others); Mon, 25 Sep 2023 12:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbjIYQ5a (ORCPT ); Mon, 25 Sep 2023 12:57:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D139110D; Mon, 25 Sep 2023 09:57:23 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EA55C433C7; Mon, 25 Sep 2023 16:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695661043; bh=/TClsZXVGXCV9uINJx9IgXVRoHxhac9DAEBNZbscd1w=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=WBNUXt/WPWhBOc7FN29nn/y8nh1h4+x9bTO6ai3NHcfLzlWG/RF6iEYi1pEp1HTh8 4LwFwL0c28Mm3QpAWj77WQVmkvBNkEA5CR6+zaET2Tlk2gaYI/0IrX/HOpkMeoOXyb cPRErNZxEP2NLg9LCXSqWIwcIYiputLZ3MLdTsN12Q68acODnioW443+WPg+HKIizl Nd/Z1N48K4NZ1DXFnadVJkdgIPRFCwXvnphpYImcEgrmtpxS/DHAc9lqiYJIEazOF2 8r33lZHLd77+B7WO3wIROGBDbMbJwg0Yueyzyb71wNWRiLWJ6wUFrQTOGAvx3S6DS/ 40ITz+rb7puIw== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 25 Sep 2023 19:57:17 +0300 Message-Id: Cc: , , , , , , Subject: Re: [PATCH v4 01/18] cgroup/misc: Add per resource callbacks for CSS events From: "Jarkko Sakkinen" To: "Haitao Huang" , , , , , , , , , , , X-Mailer: aerc 0.14.0 References: <20230913040635.28815-1-haitao.huang@linux.intel.com> <20230913040635.28815-2-haitao.huang@linux.intel.com> In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:57:34 -0700 (PDT) On Sat Sep 16, 2023 at 7:11 AM EEST, Haitao Huang wrote: > Hi Jarkko > > On Wed, 13 Sep 2023 04:39:06 -0500, Jarkko Sakkinen = =20 > wrote: > > > On Wed Sep 13, 2023 at 7:06 AM EEST, Haitao Huang wrote: > >> From: Kristen Carlson Accardi > >> > >> Consumers of the misc cgroup controller might need to perform separate > >> actions for Cgroups Subsystem State(CSS) events: cgroup alloc and free= . > > > > nit: s/State(CSS)/State (CSS)/ > > > > "cgroup alloc" and "cgroup free" mean absolutely nothing. > > > > > >> In addition, writes to the max value may also need separate action. Ad= d > > > > What "the max value"? > > > >> the ability to allow downstream users to setup callbacks for these > >> operations, and call the corresponding per-resource-type callback when > >> appropriate. > > > > Who are "the downstream users" and what sort of callbacks they setup? > > How about this? > > The misc cgroup controller (subsystem) currently does not perform resourc= e =20 > type specific action for Cgroups Subsystem State (CSS) events: the =20 > 'css_alloc' event when a cgroup is created and the 'css_free' event when = a =20 > cgroup is destroyed, or in event of user writing the max value to the =20 > misc.max file to set the consumption limit of a specific resource =20 > [admin-guide/cgroup-v2.rst, 5-9. Misc]. > > Define callbacks for those events and allow resource providers to registe= r =20 > the callbacks per resource type as needed. This will be utilized later by= =20 > the EPC misc cgroup support implemented in the SGX driver: > - On cgroup alloc, allocate and initialize necessary structures for EPC = =20 > reclaiming, e.g., LRU list, work queue, etc. > - On cgroup free, cleanup and free those structures created in alloc. > - On max write, trigger EPC reclaiming if the new limit is at or below = =20 > current consumption. Yeah, this is much better (I was on holiday, thus the delay on response). > Thanks > Haitao BR, Jarkko