Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1258085pxb; Thu, 4 Mar 2021 07:13:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDcra/dZwLAoDw2Qm3RL4ydww9hiM25xN8CHIZxp4AqUE/gKSRYenToAIDE9kGDFgFD1DG X-Received: by 2002:a17:907:2953:: with SMTP id et19mr4608509ejc.527.1614870796254; Thu, 04 Mar 2021 07:13:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614870796; cv=none; d=google.com; s=arc-20160816; b=jBwtGLYETNMQRvk+VuS4b1w8j7ly8fjIQmH4P/LkXiC0SdbNJ7Lj1IKMOvXZYY4MxT dFJ60f5GbEkqaZpVMetjcHYAEPLhc+lOiAu93oRFgrbR+c6NrAJ3XA6ICPe/r3cQotXY GjM5tWgBzhzS16cDUtGTCC4SNDuXQccFYROKHi0OWST+yDBQZpgcLONp7yMAUCmjRkY7 lQxv18DmzOMHQoB5okkN3s3dMo5+/S+01G+rl4LdUBHS5Cv1p/oXq+AjyuJ8Kh+a4yPv gBgTbNZ7aLSdj3/qT+FSkpJYOOOFtBfCNcyf3odGRLbHsHUyPgRANAt8uOBL68VA5lK3 4GyQ== 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=wa5muaXHut4hfwXTsUBvUfthAuhKwhmv9/hS3aAHRxQ=; b=WrlEo7se2gqW5qQQqyF2uAkJnEUygPj1PyQECtqE0UBdnsJd5lgqbldhJ9d3pZXiy0 ubo3R1be+YsyeJZwD0pro7UXZDWVvCIQGaluhmoHqf62Sfj5D2Vg7cr3lB91ZfJWNo03 bqrzGY4SdIuhCRWlZs1IfVRsiXYs4YJLjLiidkUIzMkWe1y0o1ol6jOAxutyazxxj7qO aG1+t55Z2CzZfEWSHo62oFH5BOUrN7D7BS/Ou1ZvGPdhD715r5x4tRJi/V/tV5R06udm VS0YVkTpQolGeuitrYP3J7JgIXWkVQ4foJxGu0kaorFQqPNTykHQTi/+Xwvpa7gm4brr ji9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ei8dVn1t; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj7si2680958edb.378.2021.03.04.07.12.49; Thu, 04 Mar 2021 07:13:16 -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=@google.com header.s=20161025 header.b=Ei8dVn1t; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235074AbhCDGXW (ORCPT + 99 others); Thu, 4 Mar 2021 01:23:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235072AbhCDGWt (ORCPT ); Thu, 4 Mar 2021 01:22:49 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6670EC061574 for ; Wed, 3 Mar 2021 22:22:09 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id d12so15631752pfo.7 for ; Wed, 03 Mar 2021 22:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wa5muaXHut4hfwXTsUBvUfthAuhKwhmv9/hS3aAHRxQ=; b=Ei8dVn1tS3L8d+KCjI+VuCzSj+Cfa7yV0HFL1DM94rBiWSDms9SHkHwivMYn04bjmx OY7XuGQpzmXg0EUzXpFAvpzAbXLTJKYqOnctbovAHMT8rOH5KdM45V87GeUhl5QmBmOf 9SsmlkYM/nbtIcpXpwLUik8NdP/SeznAYt/+RCuNSN4C49b2N8+qrYgTtMsFHLPlCq3i oFaz4h5lYyjePLRasP1ShTXGMxKB4OpTzRm53eQV4pK89hTc9zr8XIMmx5W/jGKNj+L3 M9VgZ1z/fQqUt6B/WABIinlH+Kr151hgBCYsKRas0sZSUw/S+UXNv+4IxVwtGr+bxBZB 7OiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wa5muaXHut4hfwXTsUBvUfthAuhKwhmv9/hS3aAHRxQ=; b=rsCSmMbvVsMEZ/tEvJcp7b9umNOHiY6fvD3oS5Kd2YzOsvL6EDVTdRLeQ595VWHe8x h0d3nfISSXQfFK8aUhVZLhJ3Tq4qkx+zXnBL/nv8Ab0f38ItgzfUx8GnENY9Cp3ZAkKP xNKNAGoONMAOZdpCVef0Oj/BbniK/YztUTimyRsYq2BaN6q69Bt8Z5ft+JlQEq6KEaFv nERW3+KuY6dliGbarLZGp7Y3ocOW9jKZm+zYYRRMCGF6tk++oFCxEAG0AWap068RMlg3 ikC3VpygwSDUOcQ8amLcrMlBhCgTtzmlL00mmFN9e/Q5jssiXp6Xn7V/Abd+AwXRd4zK d4Ug== X-Gm-Message-State: AOAM531cl5en6JHQvhva3V5xXKhtgmZxT1AbGmGyZpw41Nr+woBEjQRq LkFRwo0I/IJVm2OPHxhyFwBQOA== X-Received: by 2002:a63:3e03:: with SMTP id l3mr1928769pga.452.1614838928731; Wed, 03 Mar 2021 22:22:08 -0800 (PST) Received: from google.com ([2620:0:1008:10:5ddf:a7e:5239:ef47]) by smtp.gmail.com with ESMTPSA id q128sm26609812pfb.51.2021.03.03.22.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 22:22:08 -0800 (PST) Date: Wed, 3 Mar 2021 22:22:03 -0800 From: Vipin Sharma To: Jacob Pan 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, "Tian, Kevin" , "Liu, Yi L" , "Raj, Ashok" , Alex Williamson , Jason Gunthorpe Subject: Re: [RFC v2 2/2] cgroup: sev: Miscellaneous cgroup documentation. Message-ID: References: <20210302081705.1990283-1-vipinsh@google.com> <20210302081705.1990283-3-vipinsh@google.com> <20210303185513.27e18fce@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210303185513.27e18fce@jacob-builder> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 06:55:13PM -0800, Jacob Pan wrote: > 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. I think it makes sense to add support for migration for the resources which need it. Resources like SEV, SEV-ES will not participate in migration and won't stop can_attach() to succeed, other resources which need migration will allow or stop based on their limits and capacity in the destination.