Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7514612pxb; Thu, 18 Feb 2021 12:06:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIVUnui/KIT8ndjI0Epgo1KYaBqXvK4SFTxciERNWvroWX/R1zOeQB7uyj8qHAKHvsQhWJ X-Received: by 2002:a17:906:b055:: with SMTP id bj21mr5687160ejb.355.1613678816706; Thu, 18 Feb 2021 12:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613678816; cv=none; d=google.com; s=arc-20160816; b=ZAUZU8tnrS9Kk7X3K5sRNpOpUoBSA3nymhWozeLcPK0sO8Hxg7icJ5mK19rw+r7HlN T7Qpe4aEMI5609OD0UaK443bPf6YX/aOON38SmOnMEjcSUtH6Grn2+G03Syd8y4oKr6N 4i5yhtVh4S5xxAJUmlO+/1aB+1aH1yq6/07aMO4jCvisrtjgBEyQFeytA9E6I2rTFbQA iVQJzoRhlAfx+Bei03Ndt8y39x2H4P1AbCCBgiH5DTbXQL2pa0CPY9oINx4X7Nj10gs0 w28/4cgFKQVQyWedv/ojjElq1dju3bBPavTq0H5ql1MxAQK9KsFjS+/1RUTIqqtq51SI ZlgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=7bVBB7/eb43F7sJCb2A73jGKQH5d6crP4qDBABCXugI=; b=dP/3K4yesK8BIrpeyFLysjoS/1h1455EsK3mSHX/cvInPmFTB+rMiPZ/792QK7pPJG u3CJQmC8/kTTy+VCuOQFiweetgkxxXsA5ZFQEDIUoaBBlxJzbJEzg8Rk7bEZt9Bq9CZD tSOp25HPz9Nd7AhEQ+lQK6bBQHzta7i9aNKRaQ90gPRZJSpTbt/C9Lf3ow7UyyUcZuPy AWhi4xgVqqPkBUvwh1f81yf8JKl7FMSqV8PrglbE8pZSNTWiBNbhS9zwGj98jVFtZWKZ nroQAzxpaBtytf7uf67agFhw+bLWzvLuSJclX6M8sAK4oyZl8P1d7aV2O0vpWRc5ddZk nxBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MSGiXWGc; 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 r25si4236396edq.431.2021.02.18.12.06.30; Thu, 18 Feb 2021 12:06:56 -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=MSGiXWGc; 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 S232038AbhBRUEx (ORCPT + 99 others); Thu, 18 Feb 2021 15:04:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbhBRT4l (ORCPT ); Thu, 18 Feb 2021 14:56:41 -0500 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06AF2C061786 for ; Thu, 18 Feb 2021 11:56:01 -0800 (PST) Received: by mail-pf1-x44a.google.com with SMTP id c186so2059049pfa.23 for ; Thu, 18 Feb 2021 11:56:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=7bVBB7/eb43F7sJCb2A73jGKQH5d6crP4qDBABCXugI=; b=MSGiXWGc/XBlhRD4FT6+UEMZ+VJARxb3RibM8Xi7pgr9pz0bgTNlOAetGX3p8x57hC D9NGC/+GSPxXLIuX4N+ZhEma+EfYEksySW3hvgaO5RI92DO3YOkf+l3+Hz/4dRKkCJdf 4cMVb+Q2gHQlbE6XqbqTxkfw4bfAhObx0/dyqaDQRbt5/srIvx75jQGbX1PbYcJkSlg8 hI0qu06XNCzJQ1hwwZl3Vi7StUkGbOxBPOtK7067VGnDl7Ahv9l8EKanVlB9gfUPJ6gp ChDRajvVL/VyOf74x+UM1yxcIda7D3fmjy8aa7r0MT38Aa/sNHX4SLupLZYl1t5ZYLIJ 5EvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=7bVBB7/eb43F7sJCb2A73jGKQH5d6crP4qDBABCXugI=; b=JMoLmahEpr137PAsH8BUv+w7f2uS9q2Mx3X1MUN9jA9XfIR+SkHsU4BLB2hglAfklW TEEN4gtE04kbzdRmN6m62crosGHjZ/a5HlQn7OLH4WV+pjdI0DbASCZE9SKrOhxBNyjX RagARqJSjlw0uBTWzR6Z3jqT+stCiwR1jBBmBSEt3CaREpYQcpyjHuMESEEURa2G3Zsk I962uqj2YUqj60mSSMQvq0Xb9CkdmROhoBrUlaIEIqVbcpM0n6PdFv2IKYtn2CPgQkS0 eMLLGEc2Ey9WXm5fJ+tQcpLUAJfWgPLwO7U1coG+akPfu/L11gj4TSEivbSFWAExiO6h /8vQ== X-Gm-Message-State: AOAM532oWAjWR3bRRxYGa9rkeHId5VeQHAdmtb3jBqtYLWeToTQhkMai 04zCq61g7ft7SaL8pvzb3BnjkiSC6tEs Sender: "vipinsh via sendgmr" X-Received: from vipinsh.kir.corp.google.com ([2620:0:1008:10:580f:a4a0:74ce:b3b4]) (user=vipinsh job=sendgmr) by 2002:a62:6304:0:b029:1c0:d62d:d213 with SMTP id x4-20020a6263040000b02901c0d62dd213mr5825540pfb.79.1613678160277; Thu, 18 Feb 2021 11:56:00 -0800 (PST) Date: Thu, 18 Feb 2021 11:55:47 -0800 Message-Id: <20210218195549.1696769-1-vipinsh@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.617.g56c4b15f3c-goog Subject: [RFC 0/2] cgroup: New misc cgroup controller From: Vipin Sharma To: tj@kernel.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 Cc: 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, Vipin Sharma Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This patch is creating a new misc cgroup controller for allocation and tracking of resources which are not abstract like other cgroup controllers. This controller was initially proposed as encryption_id but after the feedbacks, it is now changed to misc cgroup. https://lore.kernel.org/lkml/20210108012846.4134815-2-vipinsh@google.com/ Changes from the encryption_id controller are: 1. There are only 3 files misc.{capacity, max, current} for all resources compared to each resource having their own 3 files in encryption_id cgroup. 2. If a resource capacity is 0 then it is considered inactive and won't show up in control files. 2. This is a lockless implementation similar to page counter APIs compared to single lock implementation in encryption_id cgroup. Please provide any feedback for this RFC or if it is good for merging then I can send a patch for merging. Thanks Vipin Sharma (2): cgroup: sev: Add misc cgroup controller cgroup: sev: Miscellaneous cgroup documentation. Documentation/admin-guide/cgroup-v1/misc.rst | 1 + Documentation/admin-guide/cgroup-v2.rst | 64 ++- arch/x86/kvm/svm/sev.c | 60 ++- arch/x86/kvm/svm/svm.h | 1 + include/linux/cgroup_subsys.h | 4 + include/linux/misc_cgroup.h | 75 +++ init/Kconfig | 14 + kernel/cgroup/Makefile | 1 + kernel/cgroup/misc.c | 456 +++++++++++++++++++ 9 files changed, 664 insertions(+), 12 deletions(-) create mode 100644 Documentation/admin-guide/cgroup-v1/misc.rst create mode 100644 include/linux/misc_cgroup.h create mode 100644 kernel/cgroup/misc.c -- 2.30.0.617.g56c4b15f3c-goog