diff mbox series

[v3] drm/i915: Run relevant bits of debugfs drop_caches per GT

Message ID 20230907125808.186088-1-andi.shyti@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v3] drm/i915: Run relevant bits of debugfs drop_caches per GT | expand

Commit Message

Andi Shyti Sept. 7, 2023, 12:58 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Walk all GTs when doing the respective bits of drop_caches work.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
Hi,

I'm proposing this new version of the series I sent here[*].
Patch 1 from that series is not necessary so taht I'm going to
propose the original version proposed by Tvrtko when we were
young.

Andi

Changelog
=========
v2 -> v3:
 - fix the "for_each_gt()" parameter order.
v1 -> v2:
 - drop the gt idling and the cache flushing decoupling and stick
   to the original version.

[*] https://patchwork.freedesktop.org/series/123301/

 drivers/gpu/drm/i915/i915_debugfs.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Rodrigo Vivi Sept. 7, 2023, 1:47 p.m. UTC | #1
On Thu, Sep 07, 2023 at 02:58:08PM +0200, Andi Shyti wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Walk all GTs when doing the respective bits of drop_caches work.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
> Hi,
> 
> I'm proposing this new version of the series I sent here[*].
> Patch 1 from that series is not necessary so taht I'm going to
> propose the original version proposed by Tvrtko when we were
> young.
> 
> Andi
> 
> Changelog
> =========
> v2 -> v3:
>  - fix the "for_each_gt()" parameter order.
> v1 -> v2:
>  - drop the gt idling and the cache flushing decoupling and stick
>    to the original version.
> 
> [*] https://patchwork.freedesktop.org/series/123301/
> 
>  drivers/gpu/drm/i915/i915_debugfs.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 7a90a2e32c9f1..e9b79c2c37d84 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -740,15 +740,19 @@ 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);
>  
> -	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;
> +	}
>  
>  	fs_reclaim_acquire(GFP_KERNEL);
>  	flags = memalloc_noreclaim_save();
> -- 
> 2.40.1
>
Nirmoy Das Sept. 7, 2023, 1:49 p.m. UTC | #2
On 9/7/2023 2:58 PM, Andi Shyti wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Walk all GTs when doing the respective bits of drop_caches work.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> Hi,
>
> I'm proposing this new version of the series I sent here[*].
> Patch 1 from that series is not necessary so taht I'm going to
> propose the original version proposed by Tvrtko when we were
> young.
>
> Andi
>
> Changelog
> =========
> v2 -> v3:
>   - fix the "for_each_gt()" parameter order.
> v1 -> v2:
>   - drop the gt idling and the cache flushing decoupling and stick
>     to the original version.
>
> [*] https://patchwork.freedesktop.org/series/123301/
>
>   drivers/gpu/drm/i915/i915_debugfs.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 7a90a2e32c9f1..e9b79c2c37d84 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -740,15 +740,19 @@ 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);
>   
> -	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;
> +	}
>   
>   	fs_reclaim_acquire(GFP_KERNEL);
>   	flags = memalloc_noreclaim_save();
Andi Shyti Sept. 8, 2023, 10:23 p.m. UTC | #3
Hi Rodrigo and Nirmoy,

On Thu, Sep 07, 2023 at 09:47:19AM -0400, Rodrigo Vivi wrote:
> On Thu, Sep 07, 2023 at 02:58:08PM +0200, Andi Shyti wrote:
> > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > 
> > Walk all GTs when doing the respective bits of drop_caches work.
> > 
> > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

thanks for your review, pushed to drm-intel-gt-next.

Andi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7a90a2e32c9f1..e9b79c2c37d84 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -740,15 +740,19 @@  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);
 
-	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;
+	}
 
 	fs_reclaim_acquire(GFP_KERNEL);
 	flags = memalloc_noreclaim_save();