All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuansheng Liu <chuansheng.liu@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v3] i915/pm_rps: install SIGTERM handler for load_helper process
Date: Fri, 22 Nov 2019 01:19:34 +0000	[thread overview]
Message-ID: <20191122011934.29606-1-chuansheng.liu@intel.com> (raw)

Reference:
https://bugs.freedesktop.org/show_bug.cgi?id=112126

The issue we hit is the GPU keeps very high load after running
the subtest min-max-config-loaded.

Some background of the issue:
Currently the rps is not fully enabled yet on TGL, and running
the subtest min-max-config-loaded will hit below assertion:
==
(i915_pm_rps:1261) CRITICAL: Test assertion failure function loaded_check, file ../tests/i915/i915_pm_rps.c:505:
(i915_pm_rps:1261) CRITICAL: Failed assertion: freqs[MAX] <= freqs[CUR]
(i915_pm_rps:1261) CRITICAL: Last errno: 2, No such file or directory
==

with igt stress test, we find the GT keeps busy after running
this subtest, it is due to the igt_spin_end() is not called
randomly.

The root cause analysis is:
When the main process i915_pm_rps for running the subtest
min-max-config-loaded hits the assertion, the main process will
try to send signal SIGTERM to the child process loader_helper
which is created by main process for starting GT load, then the
main process itself will exit.

The SIGTERM handler for loader_helper is the default one, which
will cause the loader_helper exits directly. That is unsafe, we
always expect the igt_spin_end() is called before loader_helper
process exits, which is used to stop the load of GT.

Furthermore, in normal scenario, before main process exits,
it will send SIGUSR1 to child process for stopping GT loading
in safe way.

So here we install the proper handler for signal SIGTERM in the
similar way. Without this patch, the GT may keep busy after
running this subtest. Enabling rps should be tracked on the
other side.

V3: As suggested by Chris, s/SIGUSR1/SIGTERM, since both signals
take the same function.

Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
---
 tests/i915/i915_pm_rps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
index ef627c0b..51605f29 100644
--- a/tests/i915/i915_pm_rps.c
+++ b/tests/i915/i915_pm_rps.c
@@ -250,7 +250,7 @@ static void load_helper_run(enum load load)
 		bool prev_load;
 		uint32_t handle;
 
-		signal(SIGUSR1, load_helper_signal_handler);
+		signal(SIGTERM, load_helper_signal_handler);
 		signal(SIGUSR2, load_helper_signal_handler);
 
 		igt_debug("Applying %s load...\n", lh.load ? "high" : "low");
@@ -320,7 +320,7 @@ static void load_helper_run(enum load load)
 
 static void load_helper_stop(void)
 {
-	kill(lh.igt_proc.pid, SIGUSR1);
+	kill(lh.igt_proc.pid, SIGTERM);
 	igt_assert(igt_wait_helper(&lh.igt_proc) == 0);
 }
 
-- 
2.17.1

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

WARNING: multiple messages have this Message-ID (diff)
From: Chuansheng Liu <chuansheng.liu@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t v3] i915/pm_rps: install SIGTERM handler for load_helper process
Date: Fri, 22 Nov 2019 01:19:34 +0000	[thread overview]
Message-ID: <20191122011934.29606-1-chuansheng.liu@intel.com> (raw)
Message-ID: <20191122011934.pHpRfkmW9YXYEM0I9-aQ7jSreXWIEAG_QWPrXpJsndM@z> (raw)

Reference:
https://bugs.freedesktop.org/show_bug.cgi?id=112126

The issue we hit is the GPU keeps very high load after running
the subtest min-max-config-loaded.

Some background of the issue:
Currently the rps is not fully enabled yet on TGL, and running
the subtest min-max-config-loaded will hit below assertion:
==
(i915_pm_rps:1261) CRITICAL: Test assertion failure function loaded_check, file ../tests/i915/i915_pm_rps.c:505:
(i915_pm_rps:1261) CRITICAL: Failed assertion: freqs[MAX] <= freqs[CUR]
(i915_pm_rps:1261) CRITICAL: Last errno: 2, No such file or directory
==

with igt stress test, we find the GT keeps busy after running
this subtest, it is due to the igt_spin_end() is not called
randomly.

The root cause analysis is:
When the main process i915_pm_rps for running the subtest
min-max-config-loaded hits the assertion, the main process will
try to send signal SIGTERM to the child process loader_helper
which is created by main process for starting GT load, then the
main process itself will exit.

The SIGTERM handler for loader_helper is the default one, which
will cause the loader_helper exits directly. That is unsafe, we
always expect the igt_spin_end() is called before loader_helper
process exits, which is used to stop the load of GT.

Furthermore, in normal scenario, before main process exits,
it will send SIGUSR1 to child process for stopping GT loading
in safe way.

So here we install the proper handler for signal SIGTERM in the
similar way. Without this patch, the GT may keep busy after
running this subtest. Enabling rps should be tracked on the
other side.

V3: As suggested by Chris, s/SIGUSR1/SIGTERM, since both signals
take the same function.

Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
---
 tests/i915/i915_pm_rps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
index ef627c0b..51605f29 100644
--- a/tests/i915/i915_pm_rps.c
+++ b/tests/i915/i915_pm_rps.c
@@ -250,7 +250,7 @@ static void load_helper_run(enum load load)
 		bool prev_load;
 		uint32_t handle;
 
-		signal(SIGUSR1, load_helper_signal_handler);
+		signal(SIGTERM, load_helper_signal_handler);
 		signal(SIGUSR2, load_helper_signal_handler);
 
 		igt_debug("Applying %s load...\n", lh.load ? "high" : "low");
@@ -320,7 +320,7 @@ static void load_helper_run(enum load load)
 
 static void load_helper_stop(void)
 {
-	kill(lh.igt_proc.pid, SIGUSR1);
+	kill(lh.igt_proc.pid, SIGTERM);
 	igt_assert(igt_wait_helper(&lh.igt_proc) == 0);
 }
 
-- 
2.17.1

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

WARNING: multiple messages have this Message-ID (diff)
From: Chuansheng Liu <chuansheng.liu@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3] i915/pm_rps: install SIGTERM handler for load_helper process
Date: Fri, 22 Nov 2019 01:19:34 +0000	[thread overview]
Message-ID: <20191122011934.29606-1-chuansheng.liu@intel.com> (raw)

Reference:
https://bugs.freedesktop.org/show_bug.cgi?id=112126

The issue we hit is the GPU keeps very high load after running
the subtest min-max-config-loaded.

Some background of the issue:
Currently the rps is not fully enabled yet on TGL, and running
the subtest min-max-config-loaded will hit below assertion:
==
(i915_pm_rps:1261) CRITICAL: Test assertion failure function loaded_check, file ../tests/i915/i915_pm_rps.c:505:
(i915_pm_rps:1261) CRITICAL: Failed assertion: freqs[MAX] <= freqs[CUR]
(i915_pm_rps:1261) CRITICAL: Last errno: 2, No such file or directory
==

with igt stress test, we find the GT keeps busy after running
this subtest, it is due to the igt_spin_end() is not called
randomly.

The root cause analysis is:
When the main process i915_pm_rps for running the subtest
min-max-config-loaded hits the assertion, the main process will
try to send signal SIGTERM to the child process loader_helper
which is created by main process for starting GT load, then the
main process itself will exit.

The SIGTERM handler for loader_helper is the default one, which
will cause the loader_helper exits directly. That is unsafe, we
always expect the igt_spin_end() is called before loader_helper
process exits, which is used to stop the load of GT.

Furthermore, in normal scenario, before main process exits,
it will send SIGUSR1 to child process for stopping GT loading
in safe way.

So here we install the proper handler for signal SIGTERM in the
similar way. Without this patch, the GT may keep busy after
running this subtest. Enabling rps should be tracked on the
other side.

V3: As suggested by Chris, s/SIGUSR1/SIGTERM, since both signals
take the same function.

Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
---
 tests/i915/i915_pm_rps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
index ef627c0b..51605f29 100644
--- a/tests/i915/i915_pm_rps.c
+++ b/tests/i915/i915_pm_rps.c
@@ -250,7 +250,7 @@ static void load_helper_run(enum load load)
 		bool prev_load;
 		uint32_t handle;
 
-		signal(SIGUSR1, load_helper_signal_handler);
+		signal(SIGTERM, load_helper_signal_handler);
 		signal(SIGUSR2, load_helper_signal_handler);
 
 		igt_debug("Applying %s load...\n", lh.load ? "high" : "low");
@@ -320,7 +320,7 @@ static void load_helper_run(enum load load)
 
 static void load_helper_stop(void)
 {
-	kill(lh.igt_proc.pid, SIGUSR1);
+	kill(lh.igt_proc.pid, SIGTERM);
 	igt_assert(igt_wait_helper(&lh.igt_proc) == 0);
 }
 
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-11-22  1:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  1:19 Chuansheng Liu [this message]
2019-11-22  1:19 ` [igt-dev] [PATCH i-g-t v3] i915/pm_rps: install SIGTERM handler for load_helper process Chuansheng Liu
2019-11-22  1:19 ` [Intel-gfx] " Chuansheng Liu
2019-11-22  2:13 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/pm_rps: install SIGTERM handler for load_helper process (rev2) Patchwork
2019-11-23  9:47 ` [igt-dev] ✓ 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=20191122011934.29606-1-chuansheng.liu@intel.com \
    --to=chuansheng.liu@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@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.