Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
@ 2023-09-07 10:11 Andi Shyti
  2023-09-07 12:26 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andi Shyti @ 2023-09-07 10:11 UTC (permalink / raw)
  To: Tvrtko Ursulin, Nirmoy Das; +Cc: intel-gfx

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
=========
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..21373f7fec30c 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(i915, i, gt) {
+		ret = gt_drop_caches(gt, val);
+		if (ret)
+			return ret;
+	}
 
 	fs_reclaim_acquire(GFP_KERNEL);
 	flags = memalloc_noreclaim_save();
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Run relevant bits of debugfs drop_caches per GT
  2023-09-07 10:11 [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT Andi Shyti
@ 2023-09-07 12:26 ` Patchwork
  2023-09-07 12:32 ` [Intel-gfx] [PATCH v2] " kernel test robot
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-09-07 12:26 UTC (permalink / raw)
  To: Andi Shyti; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Run relevant bits of debugfs drop_caches per GT
URL   : https://patchwork.freedesktop.org/series/123386/
State : failure

== Summary ==

Error: make failed
  CALL    scripts/checksyscalls.sh
  DESCEND objtool
  INSTALL libsubcmd_headers
  CC [M]  drivers/gpu/drm/i915/i915_debugfs.o
In file included from drivers/gpu/drm/i915/i915_debugfs.c:36:
drivers/gpu/drm/i915/i915_debugfs.c: In function ‘i915_drop_caches_set’:
drivers/gpu/drm/i915/gt/intel_gt.h:170:14: error: comparison between pointer and integer [-Werror]
  170 |       (id__) < I915_MAX_GT; \
      |              ^
drivers/gpu/drm/i915/i915_debugfs.c:751:2: note: in expansion of macro ‘for_each_gt’
  751 |  for_each_gt(i915, i, gt) {
      |  ^~~~~~~~~~~
In file included from ./include/drm/drm_connector.h:32,
                 from ./drivers/gpu/drm/i915/display/intel_display_core.h:16,
                 from ./drivers/gpu/drm/i915/i915_drv.h:40,
                 from ./drivers/gpu/drm/i915/gt/intel_context.h:14,
                 from drivers/gpu/drm/i915/gem/i915_gem_context.h:12,
                 from drivers/gpu/drm/i915/i915_debugfs.c:35:
drivers/gpu/drm/i915/gt/intel_gt.h:172:33: error: invalid type argument of ‘->’ (have ‘unsigned int’)
  172 |   for_each_if(((gt__) = (i915__)->gt[(id__)]))
      |                                 ^~
./include/drm/drm_util.h:63:38: note: in definition of macro ‘for_each_if’
   63 | #define for_each_if(condition) if (!(condition)) {} else
      |                                      ^~~~~~~~~
drivers/gpu/drm/i915/i915_debugfs.c:751:2: note: in expansion of macro ‘for_each_gt’
  751 |  for_each_gt(i915, i, gt) {
      |  ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[6]: *** [scripts/Makefile.build:243: drivers/gpu/drm/i915/i915_debugfs.o] Error 1
make[5]: *** [scripts/Makefile.build:480: drivers/gpu/drm/i915] Error 2
make[4]: *** [scripts/Makefile.build:480: drivers/gpu/drm] Error 2
make[3]: *** [scripts/Makefile.build:480: drivers/gpu] Error 2
make[2]: *** [scripts/Makefile.build:480: drivers] Error 2
make[1]: *** [/home/kbuild2/kernel/Makefile:2032: .] Error 2
make: *** [Makefile:234: __sub-make] Error 2
Build failed, no error log produced



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
  2023-09-07 10:11 [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT Andi Shyti
  2023-09-07 12:26 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
@ 2023-09-07 12:32 ` kernel test robot
  2023-09-07 12:43 ` kernel test robot
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-09-07 12:32 UTC (permalink / raw)
  To: Andi Shyti, Tvrtko Ursulin, Nirmoy Das; +Cc: intel-gfx, oe-kbuild-all

Hi Andi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-tip/drm-tip]

url:    https://github.com/intel-lab-lkp/linux/commits/Andi-Shyti/drm-i915-Run-relevant-bits-of-debugfs-drop_caches-per-GT/20230907-181322
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
patch link:    https://lore.kernel.org/r/20230907101135.176326-1-andi.shyti%40linux.intel.com
patch subject: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
config: i386-debian-10.3 (https://download.01.org/0day-ci/archive/20230907/202309072011.nQPrRcF6-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230907/202309072011.nQPrRcF6-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309072011.nQPrRcF6-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/i915_debugfs.c:36:
   drivers/gpu/drm/i915/i915_debugfs.c: In function 'i915_drop_caches_set':
>> drivers/gpu/drm/i915/gt/intel_gt.h:170:21: warning: comparison between pointer and integer
     170 |              (id__) < I915_MAX_GT; \
         |                     ^
   drivers/gpu/drm/i915/i915_debugfs.c:751:9: note: in expansion of macro 'for_each_gt'
     751 |         for_each_gt(i915, i, gt) {
         |         ^~~~~~~~~~~
   In file included from include/drm/drm_connector.h:32,
                    from drivers/gpu/drm/i915/display/intel_display_core.h:16,
                    from drivers/gpu/drm/i915/i915_drv.h:40,
                    from drivers/gpu/drm/i915/gt/intel_context.h:14,
                    from drivers/gpu/drm/i915/gem/i915_gem_context.h:12,
                    from drivers/gpu/drm/i915/i915_debugfs.c:35:
   drivers/gpu/drm/i915/gt/intel_gt.h:172:47: error: invalid type argument of '->' (have 'unsigned int')
     172 |                 for_each_if(((gt__) = (i915__)->gt[(id__)]))
         |                                               ^~
   include/drm/drm_util.h:63:38: note: in definition of macro 'for_each_if'
      63 | #define for_each_if(condition) if (!(condition)) {} else
         |                                      ^~~~~~~~~
   drivers/gpu/drm/i915/i915_debugfs.c:751:9: note: in expansion of macro 'for_each_gt'
     751 |         for_each_gt(i915, i, gt) {
         |         ^~~~~~~~~~~


vim +170 drivers/gpu/drm/i915/gt/intel_gt.h

bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  167  
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  168  #define for_each_gt(gt__, i915__, id__) \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  169  	for ((id__) = 0; \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19 @170  	     (id__) < I915_MAX_GT; \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  171  	     (id__)++) \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  172  		for_each_if(((gt__) = (i915__)->gt[(id__)]))
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  173  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
  2023-09-07 10:11 [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT Andi Shyti
  2023-09-07 12:26 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
  2023-09-07 12:32 ` [Intel-gfx] [PATCH v2] " kernel test robot
@ 2023-09-07 12:43 ` kernel test robot
  2023-09-07 12:55 ` Andi Shyti
  2023-09-07 13:37 ` kernel test robot
  4 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-09-07 12:43 UTC (permalink / raw)
  To: Andi Shyti, Tvrtko Ursulin, Nirmoy Das; +Cc: intel-gfx, oe-kbuild-all

Hi Andi,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-tip/drm-tip]

url:    https://github.com/intel-lab-lkp/linux/commits/Andi-Shyti/drm-i915-Run-relevant-bits-of-debugfs-drop_caches-per-GT/20230907-181322
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
patch link:    https://lore.kernel.org/r/20230907101135.176326-1-andi.shyti%40linux.intel.com
patch subject: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
config: i386-randconfig-013-20230907 (https://download.01.org/0day-ci/archive/20230907/202309072025.Gx2nDzVd-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230907/202309072025.Gx2nDzVd-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309072025.Gx2nDzVd-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/i915_debugfs.c:36:0:
   drivers/gpu/drm/i915/i915_debugfs.c: In function 'i915_drop_caches_set':
   drivers/gpu/drm/i915/gt/intel_gt.h:170:14: error: comparison between pointer and integer [-Werror]
          (id__) < I915_MAX_GT; \
                 ^
   drivers/gpu/drm/i915/i915_debugfs.c:751:2: note: in expansion of macro 'for_each_gt'
     for_each_gt(i915, i, gt) {
     ^~~~~~~~~~~
   In file included from include/drm/drm_connector.h:32:0,
                    from drivers/gpu/drm/i915/display/intel_display_core.h:16,
                    from drivers/gpu/drm/i915/i915_drv.h:40,
                    from drivers/gpu/drm/i915/gt/intel_context.h:14,
                    from drivers/gpu/drm/i915/gem/i915_gem_context.h:12,
                    from drivers/gpu/drm/i915/i915_debugfs.c:35:
>> drivers/gpu/drm/i915/gt/intel_gt.h:172:33: error: invalid type argument of '->' (have 'unsigned int')
      for_each_if(((gt__) = (i915__)->gt[(id__)]))
                                    ^
   include/drm/drm_util.h:63:38: note: in definition of macro 'for_each_if'
    #define for_each_if(condition) if (!(condition)) {} else
                                         ^~~~~~~~~
   drivers/gpu/drm/i915/i915_debugfs.c:751:2: note: in expansion of macro 'for_each_gt'
     for_each_gt(i915, i, gt) {
     ^~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +172 drivers/gpu/drm/i915/gt/intel_gt.h

bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  167  
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  168  #define for_each_gt(gt__, i915__, id__) \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  169  	for ((id__) = 0; \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  170  	     (id__) < I915_MAX_GT; \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  171  	     (id__)++) \
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19 @172  		for_each_if(((gt__) = (i915__)->gt[(id__)]))
bec68cc9ea42d8 Tvrtko Ursulin 2022-03-19  173  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
  2023-09-07 10:11 [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT Andi Shyti
                   ` (2 preceding siblings ...)
  2023-09-07 12:43 ` kernel test robot
@ 2023-09-07 12:55 ` Andi Shyti
  2023-09-07 13:37 ` kernel test robot
  4 siblings, 0 replies; 6+ messages in thread
From: Andi Shyti @ 2023-09-07 12:55 UTC (permalink / raw)
  To: Andi Shyti; +Cc: intel-gfx, Nirmoy Das

> -	ret = gt_drop_caches(to_gt(i915), val);
> -	if (ret)
> -		return ret;
> +	for_each_gt(i915, i, gt) {

argh... I forgot to add this change before formatting the patch

-       for_each_gt(i915, i, gt) {
+       for_each_gt(gt, i915, i) {

Will resend.

Andi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
  2023-09-07 10:11 [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT Andi Shyti
                   ` (3 preceding siblings ...)
  2023-09-07 12:55 ` Andi Shyti
@ 2023-09-07 13:37 ` kernel test robot
  4 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-09-07 13:37 UTC (permalink / raw)
  To: Andi Shyti, Tvrtko Ursulin, Nirmoy Das; +Cc: intel-gfx, llvm, oe-kbuild-all

Hi Andi,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-tip/drm-tip]

url:    https://github.com/intel-lab-lkp/linux/commits/Andi-Shyti/drm-i915-Run-relevant-bits-of-debugfs-drop_caches-per-GT/20230907-181322
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
patch link:    https://lore.kernel.org/r/20230907101135.176326-1-andi.shyti%40linux.intel.com
patch subject: [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT
config: x86_64-buildonly-randconfig-003-20230907 (https://download.01.org/0day-ci/archive/20230907/202309072112.hlih7zXW-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230907/202309072112.hlih7zXW-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309072112.hlih7zXW-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/gpu/drm/i915/i915_debugfs.c:751:2: warning: ordered comparison between pointer and integer ('struct intel_gt *' and 'int')
           for_each_gt(i915, i, gt) {
           ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/gt/intel_gt.h:170:14: note: expanded from macro 'for_each_gt'
                (id__) < I915_MAX_GT; \
                ~~~~~~ ^ ~~~~~~~~~~~
>> drivers/gpu/drm/i915/i915_debugfs.c:751:2: error: member reference type 'unsigned int' is not a pointer
           for_each_gt(i915, i, gt) {
           ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/gt/intel_gt.h:172:35: note: expanded from macro 'for_each_gt'
                   for_each_if(((gt__) = (i915__)->gt[(id__)]))
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
   include/drm/drm_util.h:63:38: note: expanded from macro 'for_each_if'
   #define for_each_if(condition) if (!(condition)) {} else
                                        ^~~~~~~~~
>> drivers/gpu/drm/i915/i915_debugfs.c:751:2: error: array subscript is not an integer
           for_each_gt(i915, i, gt) {
           ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/gt/intel_gt.h:172:37: note: expanded from macro 'for_each_gt'
                   for_each_if(((gt__) = (i915__)->gt[(id__)]))
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/drm/drm_util.h:63:38: note: expanded from macro 'for_each_if'
   #define for_each_if(condition) if (!(condition)) {} else
                                        ^~~~~~~~~
   1 warning and 2 errors generated.


vim +751 drivers/gpu/drm/i915/i915_debugfs.c

   738	
   739	static int
   740	i915_drop_caches_set(void *data, u64 val)
   741	{
   742		struct drm_i915_private *i915 = data;
   743		struct intel_gt *gt;
   744		unsigned int flags;
   745		unsigned int i;
   746		int ret;
   747	
   748		drm_dbg(&i915->drm, "Dropping caches: 0x%08llx [0x%08llx]\n",
   749			val, val & DROP_ALL);
   750	
 > 751		for_each_gt(i915, i, gt) {
   752			ret = gt_drop_caches(gt, val);
   753			if (ret)
   754				return ret;
   755		}
   756	
   757		fs_reclaim_acquire(GFP_KERNEL);
   758		flags = memalloc_noreclaim_save();
   759		if (val & DROP_BOUND)
   760			i915_gem_shrink(NULL, i915, LONG_MAX, NULL, I915_SHRINK_BOUND);
   761	
   762		if (val & DROP_UNBOUND)
   763			i915_gem_shrink(NULL, i915, LONG_MAX, NULL, I915_SHRINK_UNBOUND);
   764	
   765		if (val & DROP_SHRINK_ALL)
   766			i915_gem_shrink_all(i915);
   767		memalloc_noreclaim_restore(flags);
   768		fs_reclaim_release(GFP_KERNEL);
   769	
   770		if (val & DROP_RCU)
   771			rcu_barrier();
   772	
   773		if (val & DROP_FREED)
   774			i915_gem_drain_freed_objects(i915);
   775	
   776		return 0;
   777	}
   778	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-07 13:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07 10:11 [Intel-gfx] [PATCH v2] drm/i915: Run relevant bits of debugfs drop_caches per GT Andi Shyti
2023-09-07 12:26 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2023-09-07 12:32 ` [Intel-gfx] [PATCH v2] " kernel test robot
2023-09-07 12:43 ` kernel test robot
2023-09-07 12:55 ` Andi Shyti
2023-09-07 13:37 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox