lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241204134410.1161769-7-dev@lankhorst.se>
Date: Wed,  4 Dec 2024 14:44:06 +0100
From: Maarten Lankhorst <dev@...khorst.se>
To: linux-kernel@...r.kernel.org,
	intel-xe@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org,
	Tejun Heo <tj@...nel.org>,
	Zefan Li <lizefan.x@...edance.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Friedrich Vock <friedrich.vock@....de>,
	Maxime Ripard <mripard@...nel.org>
Cc: cgroups@...r.kernel.org,
	linux-mm@...ck.org,
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
	Maarten Lankhorst <dev@...khorst.se>
Subject: [PATCH v2 6/7] drm/xe: Hack to test with mapped pages instead of vram.

We will probably want to make this a proper region in TTM for
everything, so that we can charge VRAM twice, once for mapped
in sysmem, once for mapped in vram. That way we don't need to
deal with evict failing from lack of available memory in mapped.

Signed-off-by: Maxime Ripard <mripard@...nel.org>
Signed-off-by: Maarten Lankhorst <dev@...khorst.se>
---
 drivers/gpu/drm/xe/xe_ttm_sys_mgr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c b/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c
index 9844a8edbfe19..5450caaef52ad 100644
--- a/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c
@@ -11,6 +11,7 @@
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_range_manager.h>
 #include <drm/ttm/ttm_tt.h>
+#include <drm/drm_drv.h>
 
 #include "xe_bo.h"
 #include "xe_gt.h"
@@ -112,6 +113,10 @@ int xe_ttm_sys_mgr_init(struct xe_device *xe)
 	/* TTM limits allocation of all TTM devices by 50% of system memory */
 	gtt_size /= 2;
 
+	man->cg = drmm_cgroup_register_region(&xe->drm, "mapped", gtt_size);
+	if (IS_ERR(man->cg))
+		return PTR_ERR(man->cg);
+
 	man->use_tt = true;
 	man->func = &xe_ttm_sys_mgr_func;
 	ttm_resource_manager_init(man, &xe->ttm, gtt_size >> PAGE_SHIFT);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ