Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	Nirmoy Das <nirmoy.das@intel.com>
Subject: [Intel-gfx] [PATCH 2/2] drm/i915: When asked to drop the cache, do it per GT
Date: Tue,  5 Sep 2023 21:36:14 +0200	[thread overview]
Message-ID: <20230905193614.69771-3-andi.shyti@linux.intel.com> (raw)
In-Reply-To: <20230905193614.69771-1-andi.shyti@linux.intel.com>

When the user sends the drop caches command through the debugfs
interface, do it on all the GT's, rather than just the root GT.

Based on a patch by Tvrtko.

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3dfe8a8b7cdfe..60cdfb3e45e2a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -750,21 +750,27 @@ static int
 i915_drop_caches_set(void *data, u64 val)
 {
 	struct drm_i915_private *i915 = data;
+	struct intel_gt *gt;
 	unsigned int flags;
+	unsigned int i;
 	int ret;
 
 	drm_dbg(&i915->drm, "Dropping caches: 0x%08llx [0x%08llx]\n",
 		val, val & DROP_ALL);
 
 	/* Flush all the active requests across both GT ... */
-	ret = gt_drop_caches(to_gt(i915), val);
-	if (ret)
-		return ret;
+	for_each_gt(gt, i915, i) {
+		ret = gt_drop_caches(gt, val);
+		if (ret)
+			return ret;
+	}
 
 	/* ... then wait for idle as there may be cross-gt wakerefs. */
-	ret = gt_idle(to_gt(i915), val);
-	if (ret)
-		return ret;
+	for_each_gt(gt, i915, i) {
+		ret = gt_idle(gt, val);
+		if (ret)
+			return ret;
+	}
 
 	fs_reclaim_acquire(GFP_KERNEL);
 	flags = memalloc_noreclaim_save();
-- 
2.40.1


  parent reply	other threads:[~2023-09-05 19:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 19:36 [Intel-gfx] [PATCH 0/2] Drop caches per GT Andi Shyti
2023-09-05 19:36 ` [Intel-gfx] [PATCH 1/2] drm/i915: Split gt cache flushing and gt idling functions Andi Shyti
2023-09-07  9:04   ` Nirmoy Das
2023-09-07  9:57     ` Andi Shyti
2023-09-05 19:36 ` Andi Shyti [this message]
2023-09-06  1:37 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Drop caches per GT Patchwork
2023-09-06  3:14 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-06 11:25 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Drop caches per GT (rev2) Patchwork
2023-09-06 15:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20230905193614.69771-3-andi.shyti@linux.intel.com \
    --to=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nirmoy.das@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox