Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: lucas.demarchi@intel.com, jonathan.cavitt@intel.com,
	saurabhg.gupta@intel.com
Subject: [PATCH i-g-t] tests/xe_create: Use separate VMs per process
Date: Mon, 18 Dec 2023 06:50:51 -0800	[thread overview]
Message-ID: <20231218145051.1869466-1-jonathan.cavitt@intel.com> (raw)

We currently exercise cross-user impact in xe_create by attempting to
concurrently create a large number of exec queues on a single vm using
forked child processes.  This is unrealistic, as multiple users are more
likely to be using separate file descriptors for creating exec queues.

Update the test to reflect this use case.

Suggested-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
CC: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
CC: Lucas De Marchi <lucas.demarchi@intel.com>
CC: Kamil Konieczny <kamil.konieczny@linux.intel.com>
CC: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
---
 tests/intel/xe_create.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index 0aa32c788a..22f9464161 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -167,13 +167,9 @@ enum exec_queue_destroy {
 static void create_execqueues(int fd, enum exec_queue_destroy ed)
 {
 	struct timespec tv = { };
-	uint32_t num_engines, exec_queues_per_process, vm;
+	uint32_t exec_queues_per_process;
 	int nproc = sysconf(_SC_NPROCESSORS_ONLN), seconds;
 
-	fd = drm_reopen_driver(fd);
-	num_engines = xe_number_engines(fd);
-	vm = xe_vm_create(fd, 0, 0);
-
 	exec_queues_per_process = max_t(uint32_t, 1, MAXEXECQUEUES / nproc);
 	igt_debug("nproc: %u, exec_queues per process: %u\n", nproc, exec_queues_per_process);
 
@@ -182,8 +178,13 @@ static void create_execqueues(int fd, enum exec_queue_destroy ed)
 	igt_fork(n, nproc) {
 		struct drm_xe_engine *engine;
 		uint32_t exec_queue, exec_queues[exec_queues_per_process];
+		uint32_t num_engines, vm;
 		int idx, err, i;
 
+		fd = drm_reopen_driver(fd);
+		num_engines = xe_number_engines(fd);
+		vm = xe_vm_create(fd, 0, 0);
+
 		srandom(n);
 
 		for (i = 0; i < exec_queues_per_process; i++) {
@@ -206,12 +207,12 @@ static void create_execqueues(int fd, enum exec_queue_destroy ed)
 				xe_exec_queue_destroy(fd, exec_queues[i]);
 			}
 		}
+
+		xe_vm_destroy(fd, vm);
+		drm_close_driver(fd);
 	}
 	igt_waitchildren();
 
-	xe_vm_destroy(fd, vm);
-	drm_close_driver(fd);
-
 	seconds = igt_seconds_elapsed(&tv);
 	igt_assert_f(seconds < MAXTIME,
 		     "Creating %d exec_queues tooks too long: %d [limit: %d]\n",
-- 
2.25.1

             reply	other threads:[~2023-12-18 19:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 14:50 Jonathan Cavitt [this message]
2023-12-18 21:02 ` ✗ GitLab.Pipeline: warning for tests/xe_create: Use separate VMs per process Patchwork
2023-12-18 21:39 ` ✗ Fi.CI.BAT: failure " Patchwork
2023-12-18 23:10 ` ✓ CI.xeBAT: success " Patchwork
2023-12-19  0:40 ` ✓ Fi.CI.BAT: success for tests/xe_create: Use separate VMs per process (rev2) Patchwork
2023-12-19  2:44 ` ✓ CI.xeBAT: " Patchwork
2023-12-19  3:26 ` ✗ Fi.CI.IGT: failure " Patchwork
2023-12-19  4:48 ` [PATCH i-g-t] tests/xe_create: Use separate VMs per process Zbigniew Kempczyński
2023-12-19 15:27   ` Cavitt, Jonathan
2023-12-20  7:13     ` Zbigniew Kempczyński

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=20231218145051.1869466-1-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=saurabhg.gupta@intel.com \
    /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