From patchwork Wed Dec 4 13:44:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 13893798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7677E7716B for ; Wed, 4 Dec 2024 13:44:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 856546B0093; Wed, 4 Dec 2024 08:44:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DB4E6B0095; Wed, 4 Dec 2024 08:44:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 655406B0096; Wed, 4 Dec 2024 08:44:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 45AE86B0093 for ; Wed, 4 Dec 2024 08:44:25 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 036111A0FE2 for ; Wed, 4 Dec 2024 13:44:24 +0000 (UTC) X-FDA: 82857395502.13.0C2AE8B Received: from mblankhorst.nl (lankhorst.se [141.105.120.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 7961440003 for ; Wed, 4 Dec 2024 13:44:12 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=none; spf=none (imf17.hostedemail.com: domain of mlankhorst@mblankhorst.nl has no SPF policy when checking 141.105.120.124) smtp.mailfrom=mlankhorst@mblankhorst.nl ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733319856; a=rsa-sha256; cv=none; b=3ujt0SfTKHus0Xw5FRSCXnR7P2uV4Tg9X7rh9BpwTBCh0CmD6uJ57VLP5xq3dxKf5HLEt2 ttdkrSe8BdWUvsnboBxOACNxYsvbQTIjDXbILMNfmk0joqVaQwzqbtI85bnvixGlVDxhIU 4h8l0OoG7N+rxEeFZsRs91u+3tqigr8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=none; spf=none (imf17.hostedemail.com: domain of mlankhorst@mblankhorst.nl has no SPF policy when checking 141.105.120.124) smtp.mailfrom=mlankhorst@mblankhorst.nl ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733319856; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4x007XMGoSR3AovI90OtIMW0vKLqG7Goq9k25M5mQQU=; b=kFYjTPxdig01rwTPcufL6JkowQFTHdE+5em4BZx1KLrLZZ2oxafNiLwhq44yIRxcfd61b5 FKMS77Q18cYTkay81KZl8LTBknqQSa0/5dalgTBuE7GCITNT6FCA9aHGYAHr5oqUusbd6o FMRPIkCHpvUajohOTPcXHaWI3OliCDU= From: Maarten Lankhorst To: linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Tejun Heo , Zefan Li , Johannes Weiner , Andrew Morton , Friedrich Vock , Maxime Ripard Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Maarten Lankhorst , Maarten Lankhorst Subject: [PATCH v2 5/7] drm/amdgpu: Add cgroups implementation Date: Wed, 4 Dec 2024 14:44:05 +0100 Message-ID: <20241204134410.1161769-6-dev@lankhorst.se> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241204134410.1161769-1-dev@lankhorst.se> References: <20241204134410.1161769-1-dev@lankhorst.se> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7961440003 X-Stat-Signature: yy7e1do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aroD/PIURLMNpYJ9oplTDHDHwxGoSX6H+WEfOkzdvVCcAHDh5EtlR3x3FNNf9OQTu1uRCpKwA33POSxr7P7fVjtzqtHF85gnGiU1EA6hHNwIEoSxRwzpnk+bm7fWBK5pdkexsr7M1lbUHeKXDXr6EarjPBTcMu/qoCG81clL X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Similar to xe, enable some simple management of VRAM only. Co-developed-by: Maxime Ripard Signed-off-by: Maxime Ripard Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 7d26a962f811c..f1703a746cadd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -24,6 +24,7 @@ #include #include +#include #include "amdgpu.h" #include "amdgpu_vm.h" @@ -908,6 +909,9 @@ int amdgpu_vram_mgr_init(struct amdgpu_device *adev) struct ttm_resource_manager *man = &mgr->manager; int err; + man->cg = drmm_cgroup_register_region(adev_to_drm(adev), "vram", adev->gmc.real_vram_size); + if (IS_ERR(man->cg)) + return PTR_ERR(man->cg); ttm_resource_manager_init(man, &adev->mman.bdev, adev->gmc.real_vram_size);