Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1569891pxf; Fri, 12 Mar 2021 12:57:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQtLsTB044Ib9/ezF1zaN9RSuKhNCRnVzZl54DHlP/tWGS9hiN4xlQ4JKf7kVO29uoGHEy X-Received: by 2002:a17:906:18aa:: with SMTP id c10mr10633155ejf.248.1615582677912; Fri, 12 Mar 2021 12:57:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615582677; cv=none; d=google.com; s=arc-20160816; b=MzaNxTFYXf+EorR6Th4qaN+bTOy3L8LsDBsgmBeFvy6QcHzdA15KnvhCleGCDDA2Y4 989h2hgNGnpAZIYkGNMlBl25wPa2AFfX6okpFOscKzLdQAgO5G/Im+Sw/jtM+uLVW1Zb /NhANUJbW3gfORY52R8CPBY1nOOUsFXWOoJzevMa7sXpji98iwcyNU5o9VWsWDGOD0fc +Mc1Y9wUOG/hPZP5HYMbeSdhQggy2/t0MN87YIROABdO19gxzbJHgI2zW8iYJci+SSQ8 i+dRu5gkdJJXNHpPbY86gDM+1RPIewNF/j/qkbzemS+gLkrvi7+Uls8DBOo8MDN75n8Q 96+Q== 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=+4MkRa4PKXsG3BFXTqIFRbBC47z58WTTGze648SpeOI=; b=OujMWNDeKqGkqYeYJzb2Ggnj7Viaxxz7eGMCmZ7YwF8fNgMfTjr8CTYE1qe30NpLzh yM7hj3zKhp4Rd+tTgebFhhCC9Olhl1OPeiK291XCPe5EtVNvrWzGdwvcn8U9SnG8bfnI BYbUyjxId+SDJ1Q6eh7DFABfM5H3ZDMBSPPX66s9woY5BcWcNm86R7pNS6nv6AHhkZW2 LQgq1gA+QI0QYwEHS7zt5jnWNvOytasHrwS2gR4UIf1ixY6iTvjDwv9JB4EKhL3c+6tJ BRndluM3REM1fJAhTo261GqIWjnYmdJbwrcAKUUdn/+li0vYP42AHbWgjB4k0nRDmS7N BKpA== 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 by3si4911163edb.496.2021.03.12.12.57.35; Fri, 12 Mar 2021 12:57:57 -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 S235107AbhCLU4e (ORCPT + 99 others); Fri, 12 Mar 2021 15:56:34 -0500 Received: from mga17.intel.com ([192.55.52.151]:49632 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235011AbhCLU4Z (ORCPT ); Fri, 12 Mar 2021 15:56:25 -0500 IronPort-SDR: GZt40eTfKr0URQLU/Tc+BtdeyHeiOGDa29QSlS0yaqhhfkZjQelBAtgLDp4ucYl09L2EAWt93p oExztKn7WgQg== X-IronPort-AV: E=McAfee;i="6000,8403,9921"; a="168804613" X-IronPort-AV: E=Sophos;i="5.81,244,1610438400"; d="scan'208";a="168804613" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 12:56:02 -0800 IronPort-SDR: +yAZQZlRFxNXGrsWBVBqLoh/L0S7tpb3FBFzxMaALzYg4kQ7i99mlKqSU50VYpRr6f29lPQa1b oHgYgPF50/xw== X-IronPort-AV: E=Sophos;i="5.81,244,1610438400"; d="scan'208";a="409967645" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 12:56:02 -0800 Date: Fri, 12 Mar 2021 12:58:21 -0800 From: Jacob Pan To: Tejun Heo Cc: Vipin Sharma , 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 , jacob.jun.pan@intel.com, Jacob Pan Subject: Re: [RFC v2 2/2] cgroup: sev: Miscellaneous cgroup documentation. Message-ID: <20210312125821.22d9bfca@jacob-builder> In-Reply-To: References: <20210302081705.1990283-1-vipinsh@google.com> <20210302081705.1990283-3-vipinsh@google.com> <20210303185513.27e18fce@jacob-builder> 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 & Tejun, Sorry for the late reply, I sent from a different email address than I intended. Please see my comments inline. On Thu, 4 Mar 2021 03:51:16 -0500, Tejun Heo wrote: > Hello, > > On Wed, Mar 03, 2021 at 10:22:03PM -0800, Vipin Sharma wrote: > > > 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. > Sounds good. Perhaps some capability/feature flags for each resource such that different behavior can be accommodated? Could you please include me in your future posting? I will rebase on yours. > Please note that cgroup2 by and large don't really like or support charge > migration or even migrations themselves. We tried that w/ memcg on cgroup1 > and it turned out horrible. The expected usage model as decribed in the > doc is using migration to seed a cgroup (or even better, use the new > clone call to start in the target cgroup) and then stay there until exit. > All existing controllers assume this usage model and I'm likely to nack > deviation unless there are some super strong justifications. > Thank you so much for the pointers. Just to be clear, you meant 1. Use clone3 CLONE_INTO_CGROUP to put the child into a different cgroup. 2. Do not support migration of the parent (existing proc) Thanks, Jacob