All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Subject: [Intel-gfx] [PATCH i-g-t] i915/perf: Instantiate a local drm_fd for the unprivileged helper
Date: Thu,  2 Jul 2020 18:46:20 +0100	[thread overview]
Message-ID: <20200702174620.230048-1-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20200702123908.227124-1-chris@chris-wilson.co.uk>

While the test is blocked, we keep trying the gen12_single_ctx_helper().
As this is using the parent's drm_fd, all of our context allocations are
persistent. Reopen the device in the child so that when we exit, our
allocations are freed along with the process -- avoiding a total memory
leak if the test is stuck.

This does not explain why the test was stuck, it just prevents us from
exacerbating the error condition. Hopefully leaving the system in a more
debuggable state.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/2126
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/i915/perf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index d4ebae30d..92edc9f1f 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -4120,8 +4120,13 @@ gen12_test_single_ctx_render_target_writes_a_counter(void)
 
 	do {
 		igt_fork_helper(&child) {
+			/* A local device for local resources. */
+			drm_fd = gem_reopen_driver(drm_fd);
+
 			igt_drop_root();
 			gen12_single_ctx_helper();
+
+			close(drm_fd);
 		}
 		child_ret = igt_wait_helper(&child);
 		igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||
-- 
2.27.0

_______________________________________________
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: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Subject: [igt-dev] [PATCH i-g-t] i915/perf: Instantiate a local drm_fd for the unprivileged helper
Date: Thu,  2 Jul 2020 18:46:20 +0100	[thread overview]
Message-ID: <20200702174620.230048-1-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20200702123908.227124-1-chris@chris-wilson.co.uk>

While the test is blocked, we keep trying the gen12_single_ctx_helper().
As this is using the parent's drm_fd, all of our context allocations are
persistent. Reopen the device in the child so that when we exit, our
allocations are freed along with the process -- avoiding a total memory
leak if the test is stuck.

This does not explain why the test was stuck, it just prevents us from
exacerbating the error condition. Hopefully leaving the system in a more
debuggable state.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/2126
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/i915/perf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index d4ebae30d..92edc9f1f 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -4120,8 +4120,13 @@ gen12_test_single_ctx_render_target_writes_a_counter(void)
 
 	do {
 		igt_fork_helper(&child) {
+			/* A local device for local resources. */
+			drm_fd = gem_reopen_driver(drm_fd);
+
 			igt_drop_root();
 			gen12_single_ctx_helper();
+
+			close(drm_fd);
 		}
 		child_ret = igt_wait_helper(&child);
 		igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||
-- 
2.27.0

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

  parent reply	other threads:[~2020-07-02 17:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 12:39 [Intel-gfx] [PATCH i-g-t] i915/perf: Instantiate a local drm_fd for the unprivileged helper Chris Wilson
2020-07-02 13:05 ` Lionel Landwerlin
2020-07-02 13:05   ` [igt-dev] " Lionel Landwerlin
2020-07-02 13:10 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-07-02 17:30 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-07-02 17:46 ` Chris Wilson [this message]
2020-07-02 17:46   ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2020-07-02 18:15 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/perf: Instantiate a local drm_fd for the unprivileged helper (rev2) Patchwork
2020-07-02 23:28 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20200702174620.230048-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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.