Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] i915/i915_suspend: run in subprocess to catch oom
Date: Fri, 17 Feb 2023 16:12:41 +0100	[thread overview]
Message-ID: <20230217151241.45317-1-kamil.konieczny@linux.intel.com> (raw)

Shrink subtest can end up with oom killing it. Create subprocess
and run it from there so it will at least get reported like:

dynamic child 0 pid:70254 died with signal 9, Killed
Subtest shrink: FAIL (23.906s)

dmesg reports:

[103335.337309] Out of memory: Killed process 70254 (i915_suspend)

Cc: Riana Tauro <riana.tauro@intel.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tests/i915/i915_suspend.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c
index 815f1c8a..9798ba5c 100644
--- a/tests/i915/i915_suspend.c
+++ b/tests/i915/i915_suspend.c
@@ -176,15 +176,22 @@ test_shrink(int fd, unsigned int mode)
 	void *mem;
 
 	gem_quiescent_gpu(fd);
-	igt_purge_vm_caches(fd);
 
-	mem = igt_get_total_pinnable_mem(&size);
-	igt_assert(mem != MAP_FAILED);
+	igt_multi_fork(child, 1) {
+		fd = gem_reopen_driver(fd);
+		igt_purge_vm_caches(fd);
 
-	igt_purge_vm_caches(fd);
-	igt_system_suspend_autoresume(mode, SUSPEND_TEST_NONE);
+		mem = igt_get_total_pinnable_mem(&size);
+		igt_assert(mem != MAP_FAILED);
 
-	munmap(mem, size);
+		igt_purge_vm_caches(fd);
+		igt_system_suspend_autoresume(mode, SUSPEND_TEST_NONE);
+
+		munmap(mem, size);
+		close(fd);
+	}
+
+	igt_waitchildren();
 }
 
 static void
-- 
2.37.2

             reply	other threads:[~2023-02-17 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 15:12 Kamil Konieczny [this message]
2023-02-17 16:07 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/i915_suspend: run in subprocess to catch oom Patchwork
2023-02-18  2:55 ` [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=20230217151241.45317-1-kamil.konieczny@linux.intel.com \
    --to=kamil.konieczny@linux.intel.com \
    --cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox