Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp275475pxb; Thu, 25 Feb 2021 02:05:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlhORCHQjCOALxWipPfkJf1Ui9lQ7KPeIfTk9c4F0A/NWFmZoH4gLwE1Bi7SuFZ17Rwpfu X-Received: by 2002:a17:907:3e0c:: with SMTP id hp12mr1931706ejc.440.1614247542228; Thu, 25 Feb 2021 02:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614247542; cv=none; d=google.com; s=arc-20160816; b=xSRnCCYRtd/zlWZYxy5/izmFGdQVDNWVgzKkJ17dvUMqW7Axc1rl7GeM+uxAA05ilf kzXyE1gm8BAeIBJF4hQyQWd7C0LpUJa+bdGmLfR4Hesax96/jX/Nin/x00RoPzhxwt24 YemDtexjPW8Uan52iRNVurmFQoKPMu9YlGUUJPmGB8YG1TtonKpzDbzgZHpICnPjerdc svMKqsFniUvY/YdNtNGXKu4ewG5oXXpklujZHc+7DTbFRrYixURkJuXAfF2IaELYiz0r BWjCr8Jv4wrRb5HPJvdR59Gd/QWyavrSQNKCH/B8ydovl6BLV4BMiUP3C0pDNsqmCxGV oUdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pa5Bv87vsQTpNehYktuqD4xYQKRjzqObciTH5tWVW3c=; b=vkyD5+kwypTGKhoBMFxBQl/D5BG3t9vycwRbOSicp9agU45MYBoX8JDeAc4g/k/Erb NaqWH+JEoKkXE02lw3rh1HZ2YfbayujrJeflfpA5d9L9HIkbKHz4zd4Ps5BEHtMwrRpc HMsuJWxJjpd69S+zJ1qqCZVKBYBIS3ZlqaJkaHB8FbAwzEV8WeKG2HSL50KKMtXKMmRa qYC39lQCY0gqSIElNcvAbR/1//WZh4XOE/ittDnvcjjzky2P/5yx5Ac+xAY26I28o4DW +ZbMGC0WOuRdu1vt4naQJt0XF7SNqfnNiktV1ob7sLOmXZkc+zgK5UH0RIifMPnXSqrp 9+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=u1ctV2DO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm10si3170173ejc.64.2021.02.25.02.05.19; Thu, 25 Feb 2021 02:05:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=u1ctV2DO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235418AbhBYJyS (ORCPT + 99 others); Thu, 25 Feb 2021 04:54:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:40404 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235331AbhBYJxp (ORCPT ); Thu, 25 Feb 2021 04:53:45 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1614246779; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pa5Bv87vsQTpNehYktuqD4xYQKRjzqObciTH5tWVW3c=; b=u1ctV2DOvv5M/TvL8/NGNEplVlPYpTSVWIJY6Fgko4qtzjF/gHw0OWAMLiSHDQ2b2mkXzZ OJMe1QSJXKkXn6QoauxzkkNhwaGXQ3gVkDh7eGFtuQUB386tBsy+u3z/9gwTwUoQmKXP4R NSylMMyzM4WXnI5wUI+gcDsJ9XQ5aVI= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 23A6DADDC; Thu, 25 Feb 2021 09:52:59 +0000 (UTC) Date: Thu, 25 Feb 2021 10:52:49 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Vipin Sharma Cc: thomas.lendacky@amd.com, tj@kernel.org, brijesh.singh@amd.com, jon.grimm@amd.com, eric.vantassell@amd.com, pbonzini@redhat.com, hannes@cmpxchg.org, frankja@linux.ibm.com, borntraeger@de.ibm.com, corbet@lwn.net, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, gingell@google.com, rientjes@google.com, dionnaglaze@google.com, kvm@vger.kernel.org, x86@kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 1/2] cgroup: sev: Add misc cgroup controller Message-ID: References: <20210218195549.1696769-1-vipinsh@google.com> <20210218195549.1696769-2-vipinsh@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kWQSwDEX83EtuxH+" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --kWQSwDEX83EtuxH+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 24, 2021 at 08:57:36PM -0800, Vipin Sharma wrote: > This function is meant for hot unplug functionality too. Then I'm wondering if the current form is sufficient, i.e. the generic controller can hardly implement preemption but possibly it should prevent any additional charges of the resource. (Or this can be implemented the other subsystem and explained in the misc_cg_set_capacity() docs.) > Just to be on the same page are you talking about adding an events file > like in pids? Actually, I meant just the kernel log message. As it's the simpler part and even pid events have some inconsistencies wrt hierarchical reporting. > However, if I take reference at the first charge and remove reference at > last uncharge then I can keep the ref count in correct sync. I see now how it works. I still find it a bit complex. What about making misc_cg an input parameter and making it the callers responsibility to keep a reference? (Perhaps with helpers for the most common case.) Thanks, Michal --kWQSwDEX83EtuxH+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAmA3c20ACgkQia1+riC5 qSi9BhAAlE9yZPtCtt/Vj6a3n7ho7173BwjAGMkNrRYQK8qoh8ebExxRtCAKL0E1 lyWI0cSq4Wul9uHduKwRLljqNpBziZYHrrpaQsT7uQw4A7yn62zAU2xbqDFm558D 9TSQxO59pXdYzyemTPLmkOmkPwjHE5YUfodskMG35tbgFzIxc5SN3izteu3rl/8b A9Z2Q4Lo/iXi9qKNTpBtQzsNnhxO7ZL+ElkdhEINYX8G2H8tQ0DNVz+vXDXroMPp N3L3CA00iWrr52jtOoec3TrMsVgnlU5l3jIJASbgt4s68ukWEbgpzdHGEj8U/BfW dLoxQPNN8sWRChl4nehFtRq06z7hduHdOtqdgYq6y4UDKWJvBObjRFcPYIHuxN6W MMZOKRvm4ocUENTLK5jbv4I87E7D3457NIYUnmp0+F24tB/D5kRAkT2tNIq7nfWO e9GmQEeN30UyIudcI9NK7lHdJFEyXYasSR3nDKazdcDSBtxfQ0n65dmEVMtyMkRg e9Hot1A97AmYYSzJNoUFKKem5f75wvS+/U6dOA3gM43U/69lxNL1mQLeHVkodjTK Bz9YZgvDvx5sOsTfvmVNe2iFz5y35we5zh3hqLJWOEFSsPJ2lI2aTeVhku7x9w8N /U90fUVnkjCV7X1gKYOav/vJprMAHOv3CtkfBVp1zXdvzZO2YsE= =rCA2 -----END PGP SIGNATURE----- --kWQSwDEX83EtuxH+--