Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting
@ 2019-08-06  8:10 Chris Wilson
  2019-08-06  8:49 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2019-08-06  8:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

To actually DROP_IDLE means that we have to wait for ongoing submission,
and any new concurrently submitted, i.e. it should only be called during
single-threaded submission to ensure the GPU is idle before the new
action.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_persistent_relocs.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/i915/gem_persistent_relocs.c b/tests/i915/gem_persistent_relocs.c
index 452fe686e..14b86e11d 100644
--- a/tests/i915/gem_persistent_relocs.c
+++ b/tests/i915/gem_persistent_relocs.c
@@ -281,10 +281,13 @@ static void do_forked_test(int fd, unsigned flags)
 	struct igt_helper_process thrasher = {};
 
 	if (flags & (THRASH | THRASH_INACTIVE)) {
-		uint64_t val = (flags & THRASH_INACTIVE) ?
-				(DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL;
-
 		igt_fork_helper(&thrasher) {
+			uint64_t val;
+
+			val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND;
+			if (!(flags & THRASH_INACTIVE))
+				val |= DROP_ACTIVE;
+
 			while (1) {
 				usleep(1000);
 				igt_drop_caches_set(fd, val);
-- 
2.23.0.rc1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting
  2019-08-06  8:10 [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting Chris Wilson
@ 2019-08-06  8:49 ` Chris Wilson
  2019-08-08 15:26   ` [igt-dev] " Mika Kuoppala
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2019-08-06  8:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

To actually DROP_IDLE means that we have to wait for ongoing submission,
and any new concurrently submitted, i.e. it should only be called during
single-threaded submission to ensure the GPU is idle before the new
action.

v2: Also include SHRINK for thrash-all-the-things, and find a dupe in
gem_reloc_vs_gpu.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_persistent_relocs.c | 9 ++++++---
 tests/i915/gem_reloc_vs_gpu.c      | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/i915/gem_persistent_relocs.c b/tests/i915/gem_persistent_relocs.c
index 452fe686e..dff4e9a76 100644
--- a/tests/i915/gem_persistent_relocs.c
+++ b/tests/i915/gem_persistent_relocs.c
@@ -281,10 +281,13 @@ static void do_forked_test(int fd, unsigned flags)
 	struct igt_helper_process thrasher = {};
 
 	if (flags & (THRASH | THRASH_INACTIVE)) {
-		uint64_t val = (flags & THRASH_INACTIVE) ?
-				(DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL;
-
 		igt_fork_helper(&thrasher) {
+			uint64_t val;
+
+			val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND;
+			if (!(flags & THRASH_INACTIVE))
+				val |= DROP_ACTIVE | DROP_SHRINK_ALL;
+
 			while (1) {
 				usleep(1000);
 				igt_drop_caches_set(fd, val);
diff --git a/tests/i915/gem_reloc_vs_gpu.c b/tests/i915/gem_reloc_vs_gpu.c
index d421e4340..328730a9b 100644
--- a/tests/i915/gem_reloc_vs_gpu.c
+++ b/tests/i915/gem_reloc_vs_gpu.c
@@ -258,10 +258,13 @@ static void do_forked_test(int fd, unsigned flags)
 		igt_require_hang_ring(fd, I915_EXEC_BLT);
 
 	if (flags & (THRASH | THRASH_INACTIVE)) {
-		uint64_t val = (flags & THRASH_INACTIVE) ?
-				(DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL;
-
 		igt_fork_helper(&thrasher) {
+			uint64_t val;
+
+			val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND;
+			if (!(flags & THRASH_INACTIVE))
+				val |= DROP_ACTIVE | DROP_SHRINK_ALL;
+
 			while (1) {
 				usleep(1000);
 				igt_drop_caches_set(fd, val);
-- 
2.23.0.rc1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting
  2019-08-06  8:49 ` Chris Wilson
@ 2019-08-08 15:26   ` Mika Kuoppala
  2019-08-08 15:34     ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Kuoppala @ 2019-08-08 15:26 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev

Chris Wilson <chris@chris-wilson.co.uk> writes:

> To actually DROP_IDLE means that we have to wait for ongoing submission,
> and any new concurrently submitted, i.e. it should only be called during
> single-threaded submission to ensure the GPU is idle before the new
> action.
>
> v2: Also include SHRINK for thrash-all-the-things, and find a dupe in
> gem_reloc_vs_gpu.

Agreed that is rather pointless trying to guarantee an idle gpu
during a test.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

But between a tests, it will serve as a flush?

>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_persistent_relocs.c | 9 ++++++---
>  tests/i915/gem_reloc_vs_gpu.c      | 9 ++++++---
>  2 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/tests/i915/gem_persistent_relocs.c b/tests/i915/gem_persistent_relocs.c
> index 452fe686e..dff4e9a76 100644
> --- a/tests/i915/gem_persistent_relocs.c
> +++ b/tests/i915/gem_persistent_relocs.c
> @@ -281,10 +281,13 @@ static void do_forked_test(int fd, unsigned flags)
>  	struct igt_helper_process thrasher = {};
>  
>  	if (flags & (THRASH | THRASH_INACTIVE)) {
> -		uint64_t val = (flags & THRASH_INACTIVE) ?
> -				(DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL;
> -
>  		igt_fork_helper(&thrasher) {
> +			uint64_t val;
> +
> +			val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND;
> +			if (!(flags & THRASH_INACTIVE))
> +				val |= DROP_ACTIVE | DROP_SHRINK_ALL;
> +
>  			while (1) {
>  				usleep(1000);
>  				igt_drop_caches_set(fd, val);
> diff --git a/tests/i915/gem_reloc_vs_gpu.c b/tests/i915/gem_reloc_vs_gpu.c
> index d421e4340..328730a9b 100644
> --- a/tests/i915/gem_reloc_vs_gpu.c
> +++ b/tests/i915/gem_reloc_vs_gpu.c
> @@ -258,10 +258,13 @@ static void do_forked_test(int fd, unsigned flags)
>  		igt_require_hang_ring(fd, I915_EXEC_BLT);
>  
>  	if (flags & (THRASH | THRASH_INACTIVE)) {
> -		uint64_t val = (flags & THRASH_INACTIVE) ?
> -				(DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL;
> -
>  		igt_fork_helper(&thrasher) {
> +			uint64_t val;
> +
> +			val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND;
> +			if (!(flags & THRASH_INACTIVE))
> +				val |= DROP_ACTIVE | DROP_SHRINK_ALL;
> +
>  			while (1) {
>  				usleep(1000);
>  				igt_drop_caches_set(fd, val);
> -- 
> 2.23.0.rc1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting
  2019-08-08 15:26   ` [igt-dev] " Mika Kuoppala
@ 2019-08-08 15:34     ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2019-08-08 15:34 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx; +Cc: igt-dev

Quoting Mika Kuoppala (2019-08-08 16:26:35)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > To actually DROP_IDLE means that we have to wait for ongoing submission,
> > and any new concurrently submitted, i.e. it should only be called during
> > single-threaded submission to ensure the GPU is idle before the new
> > action.
> >
> > v2: Also include SHRINK for thrash-all-the-things, and find a dupe in
> > gem_reloc_vs_gpu.
> 
> Agreed that is rather pointless trying to guarantee an idle gpu
> during a test.
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> But between a tests, it will serve as a flush?

At the end of a _test_ (binary), we do reset and idle the GPU. The
theory is that we want each test to have a clean slate, and to catch any
residual problems in the test that created them.

But we don't do anything between subtests by default, and we frequently
run into problems there if one subtest fails and causes the next to
fail and so on and so on. An unsolved dilemma.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2019-08-08 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-06  8:10 [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting Chris Wilson
2019-08-06  8:49 ` Chris Wilson
2019-08-08 15:26   ` [igt-dev] " Mika Kuoppala
2019-08-08 15:34     ` Chris Wilson

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