All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH 2/5] drm/xe: Add debugfs files to evict everything.
Date: Fri, 26 May 2023 14:10:58 +0200	[thread overview]
Message-ID: <20230526121101.1619278-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20230526121101.1619278-1-maarten.lankhorst@linux.intel.com>

Easy for testing, when you just want your BO evicted.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/xe/xe_debugfs.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index 7827a785b020..0a2f1becb5c6 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -94,6 +94,15 @@ static const struct file_operations forcewake_all_fops = {
 	.release = forcewake_release,
 };
 
+static int evict(void *data, u64 val)
+{
+	struct ttm_resource_manager *man = data;
+
+	return ttm_resource_manager_evict_all(man->bdev, man);
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(evict_all_fops, NULL, evict, "%lld\n");
+
 void xe_debugfs_register(struct xe_device *xe)
 {
 	struct ttm_device *bdev = &xe->ttm;
@@ -119,15 +128,21 @@ void xe_debugfs_register(struct xe_device *xe)
 
 			sprintf(name, "vram%d_mm", mem_type - XE_PL_VRAM0);
 			ttm_resource_manager_create_debugfs(man, root, name);
+
+			sprintf(name, "vram%d_evict", mem_type - XE_PL_VRAM0);
+			debugfs_create_file(name, 0644, root, man, &evict_all_fops);
 		}
 	}
 
 	man = ttm_manager_type(bdev, XE_PL_TT);
 	ttm_resource_manager_create_debugfs(man, root, "gtt_mm");
+	debugfs_create_file("gtt_evict", 0644, root, man, &evict_all_fops);
 
 	man = ttm_manager_type(bdev, XE_PL_STOLEN);
-	if (man)
+	if (man) {
 		ttm_resource_manager_create_debugfs(man, root, "stolen_mm");
+		debugfs_create_file("stolen_evict", 0644, root, man, &evict_all_fops);
+	}
 
 	for_each_gt(gt, xe, id)
 		xe_gt_debugfs_register(gt);
-- 
2.34.1


  parent reply	other threads:[~2023-05-26 12:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 12:10 [Intel-xe] [PATCH 0/5] Robustness fixes with eviction and invalidation Maarten Lankhorst
2023-05-26 12:10 ` [Intel-xe] [PATCH 1/5] drm/xe: Kill small race with userptr invalidation Maarten Lankhorst
2023-05-26 12:26   ` Thomas Hellström
2023-05-26 12:10 ` Maarten Lankhorst [this message]
2023-05-26 13:02   ` [Intel-xe] [PATCH 2/5] drm/xe: Add debugfs files to evict everything Thomas Hellström
2023-05-29 13:35     ` Maarten Lankhorst
2023-05-30 14:41       ` Thomas Hellström
2023-05-30 14:54         ` Maarten Lankhorst
2023-05-26 12:10 ` [Intel-xe] [PATCH 3/5] drm/xe: Fix extobj dropping issue Maarten Lankhorst
2023-05-26 12:31   ` Thomas Hellström
2023-05-26 12:11 ` [Intel-xe] [PATCH 4/5] drm/xe: Prevent evicting for page tables Maarten Lankhorst
2023-05-26 12:35   ` Thomas Hellström
2023-05-29 13:44     ` Maarten Lankhorst
2023-05-29 15:02       ` Thomas Hellström
2023-05-29 15:11         ` Maarten Lankhorst
2023-05-29 15:13           ` Thomas Hellström
2023-05-29 15:23             ` Maarten Lankhorst
2023-05-30  8:45               ` Thomas Hellström
2023-05-30  8:50                 ` Maarten Lankhorst
2023-05-26 12:11 ` [Intel-xe] [PATCH 5/5] drm/xe: Return the correct error when dma_resv_wait_timeout fails Maarten Lankhorst
2023-05-26 12:40   ` Thomas Hellström
2023-05-26 19:15   ` Souza, Jose
2023-05-27  5:17     ` Christopher Snowhill
2023-05-29 15:21       ` Maarten Lankhorst
2023-05-26 12:13 ` [Intel-xe] ✓ CI.Patch_applied: success for Robustness fixes with eviction and invalidation Patchwork
2023-05-26 12:15 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-26 12:19 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-26 12:48 ` [Intel-xe] ○ CI.BAT: info " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230526121101.1619278-3-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.