Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1600362pxb; Thu, 4 Mar 2021 16:00:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNtYjbOqVBL8+I4JFz9EPiSahhvKEI507IEAWUjePNYINOJueHbqJij+Alsxyn5CHvVQni X-Received: by 2002:a02:9645:: with SMTP id c63mr6813057jai.84.1614902441752; Thu, 04 Mar 2021 16:00:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614902441; cv=none; d=google.com; s=arc-20160816; b=kNTx8R2z/ZKaalt7ykBCiy0R6d62JBFAS85DHjbuVo6GEf7jQYZDzGhaB1N/jUpGre TweIxBZVGCfWAN1xIeC2bJ6Vuz58XLYYf+gBDM+XGaLjCHq3LH68rE7xGXO+LNIPxaNy mtrjWqq+K8Ig5vEXgL12zkiKp0cLkf02WO6bYoQ2xIH1aF+ezhOcPn2LtMUZ/oCmCmXH /UjgzDHD7ucIK1OlrwnY8+ypFLFNrWvUT1SUVePz6x9EKd3gu1YIWvBDr5QXi2ZXVc4i ydQS3Q4o+NWKzzBhR5cIOu8m9dJS8vbtb2slmZ3hmiRD9g3Oia27riIwNdDqXswRKVsV qaaA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:ironport-sdr:ironport-sdr; bh=Iy6c2CSANBNGa88HoRBYr5S8fiycktMzKQ3orBtZyIc=; b=WQ0XIUba0mhr6+CJhN3ismQTWxLRlX7clneLB5nnmlGhwMFVCiWwA13N2jY/V8giq1 1rYgfaXNe/FXNcEZ7eO4ETmMjvOLDumpLRVgJ3M11iDd3sF/oq9oBOnP4gUhFA5xf2MM N/JMinzOaZzjgxvfIJTLxY21jwWOad/sWmkxBTMlzk635Nontrpcu89F7zOdWEQeBHgo ClLjMrMkLFJXolB36T/wtn6GtZ8XeDocAkfZEBN1biyiMYCes3vTSUYI3cj9S4ucYW76 t1T3jQBAk6tdygA/1grhMQR09jLahMLGhEjdVP25ERF7TEb7DQ++nfawGTM/QHOCSI27 paOA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si639811iln.85.2021.03.04.16.00.25; Thu, 04 Mar 2021 16:00:41 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbhCDCxu (ORCPT + 99 others); Wed, 3 Mar 2021 21:53:50 -0500 Received: from mga02.intel.com ([134.134.136.20]:13315 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbhCDCxk (ORCPT ); Wed, 3 Mar 2021 21:53:40 -0500 IronPort-SDR: uZXXVjRcj272xTsIC6QZ8/TLz3zblExCtBLugUGnYh1Oa71oRMDlIUWSMKTPSflWew/xSBupWl 9oGmCkd67syA== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="174444362" X-IronPort-AV: E=Sophos;i="5.81,221,1610438400"; d="scan'208";a="174444362" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 18:52:58 -0800 IronPort-SDR: 3i9zbih/qTnJ32Z9atLme0OLnL9sE717HSH9+ywfyQtC2DUtXDXMnSgdKq1O45rMUp+L1THRRm VfqTf3SzqBig== X-IronPort-AV: E=Sophos;i="5.81,221,1610438400"; d="scan'208";a="445547078" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 18:52:57 -0800 Date: Wed, 3 Mar 2021 18:55:13 -0800 From: Jacob Pan To: Vipin Sharma Cc: tj@kernel.org, mkoutny@suse.com, rdunlap@infradead.org, thomas.lendacky@amd.com, 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, jacob.jun.pan@intel.com, "Tian, Kevin" , "Liu, Yi L" , "Raj, Ashok" , Alex Williamson , Jason Gunthorpe Subject: Re: [RFC v2 2/2] cgroup: sev: Miscellaneous cgroup documentation. Message-ID: <20210303185513.27e18fce@jacob-builder> In-Reply-To: <20210302081705.1990283-3-vipinsh@google.com> References: <20210302081705.1990283-1-vipinsh@google.com> <20210302081705.1990283-3-vipinsh@google.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vipin, On Tue, 2 Mar 2021 00:17:05 -0800, Vipin Sharma wrote: > +Migration and Ownership > +~~~~~~~~~~~~~~~~~~~~~~~ > + > +A miscellaneous scalar resource is charged to the cgroup in which it is > used +first, and stays charged to that cgroup until that resource is > freed. Migrating +a process to a different cgroup does not move the > charge to the destination +cgroup where the process has moved. > + I am trying to see if IOASIDs cgroup can also fit in this misc controller as yet another resource type. https://lore.kernel.org/linux-iommu/20210303131726.7a8cb169@jacob-builder/T/#u However, unlike sev IOASIDs need to be migrated if the process is moved to another cgroup. i.e. charge the destination and uncharge the source. Do you think this behavior can be achieved by differentiating resource types? i.e. add attach callbacks for certain types. Having a single misc interface seems cleaner than creating another controller. Thanks, Jacob