From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>, igt-dev@lists.freedesktop.org
Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH i-g-t] tests/intel/xe_compute_preempt: Add compute-preempt-many
Date: Tue, 27 Feb 2024 08:31:54 +0100 [thread overview]
Message-ID: <fdbd6fa5-fe2d-48e3-acf9-7edc443ae916@linux.intel.com> (raw)
In-Reply-To: <20240223193919.31331-1-nirmoy.das@intel.com>
ping
On 2/23/2024 8:39 PM, Nirmoy Das wrote:
> Add compute-preempt-many which should exercise multiple
> mid-thread preemption at a time for multiple contexts.
>
> Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> lib/intel_compute.c | 24 +++++++++++++++---------
> lib/intel_compute.h | 4 +++-
> tests/intel/xe_compute_preempt.c | 27 ++++++++++++++++++++++++---
> 3 files changed, 42 insertions(+), 13 deletions(-)
>
> diff --git a/lib/intel_compute.c b/lib/intel_compute.c
> index c5d253ebc..8853b5cd3 100644
> --- a/lib/intel_compute.c
> +++ b/lib/intel_compute.c
> @@ -1686,7 +1686,8 @@ static const struct {
> };
>
> static bool __run_intel_compute_kernel_preempt(int fd,
> - struct drm_xe_engine_class_instance *eci)
> + struct drm_xe_engine_class_instance *eci,
> + unsigned int count)
> {
> unsigned int ip_ver = intel_graphics_ver(intel_get_drm_devid(fd));
> unsigned int batch;
> @@ -1719,12 +1720,16 @@ static bool __run_intel_compute_kernel_preempt(int fd,
> if (!kernels->kernel || !kernels->sip_kernel || !kernels->long_kernel)
> return 0;
>
> - intel_compute_preempt_batches[batch].compute_exec(fd, kernels->long_kernel,
> - kernels->long_kernel_size,
> - kernels->kernel, kernels->size,
> - kernels->sip_kernel,
> - kernels->sip_kernel_size,
> - eci);
> + igt_fork(child, count) {
> + intel_compute_preempt_batches[batch].compute_exec(fd, kernels->long_kernel,
> + kernels->long_kernel_size,
> + kernels->kernel, kernels->size,
> + kernels->sip_kernel,
> + kernels->sip_kernel_size,
> + eci);
> + }
> +
> + igt_waitchildren();
>
> return true;
> }
> @@ -1737,7 +1742,8 @@ static bool __run_intel_compute_kernel_preempt(int fd,
> * Returns true on success, false otherwise.
> */
> bool run_intel_compute_kernel_preempt(int fd,
> - struct drm_xe_engine_class_instance *eci)
> + struct drm_xe_engine_class_instance *eci,
> + unsigned int count)
> {
> - return __run_intel_compute_kernel_preempt(fd, eci);
> + return __run_intel_compute_kernel_preempt(fd, eci, count);
> }
> diff --git a/lib/intel_compute.h b/lib/intel_compute.h
> index fe9637b91..430bae562 100644
> --- a/lib/intel_compute.h
> +++ b/lib/intel_compute.h
> @@ -37,5 +37,7 @@ extern const struct intel_compute_kernels intel_compute_square_kernels[];
>
> bool run_intel_compute_kernel(int fd);
> bool xe_run_intel_compute_kernel_on_engine(int fd, struct drm_xe_engine_class_instance *eci);
> -bool run_intel_compute_kernel_preempt(int fd, struct drm_xe_engine_class_instance *eci);
> +bool run_intel_compute_kernel_preempt(int fd,
> + struct drm_xe_engine_class_instance *eci,
> + unsigned int count);
> #endif /* INTEL_COMPUTE_H */
> diff --git a/tests/intel/xe_compute_preempt.c b/tests/intel/xe_compute_preempt.c
> index a4e0e1454..fd245b655 100644
> --- a/tests/intel/xe_compute_preempt.c
> +++ b/tests/intel/xe_compute_preempt.c
> @@ -22,11 +22,18 @@
> * Description:
> * Exercise compute walker mid thread preemption scenario
> * Functionality: compute openCL kernel
> + *
> + * SUBTEST: compute-preempt-many
> + * GPU requirement: LNL
> + * Description:
> + * Exercise parallel compute walker mid thread preemption scenario
> + * Functionality: compute openCL kernel
> */
> static void
> -test_compute_preempt(int fd, struct drm_xe_engine_class_instance *hwe)
> +test_compute_preempt(int fd, struct drm_xe_engine_class_instance *hwe,
> + unsigned int count)
> {
> - igt_require_f(run_intel_compute_kernel_preempt(fd, hwe), "GPU not supported\n");
> + igt_require_f(run_intel_compute_kernel_preempt(fd, hwe, count), "GPU not supported\n");
> }
>
> igt_main
> @@ -44,7 +51,21 @@ igt_main
> continue;
>
> igt_dynamic_f("engine-%s", xe_engine_class_string(hwe->engine_class))
> - test_compute_preempt(xe, hwe);
> + test_compute_preempt(xe, hwe, 1);
> + }
> + }
> +
> + igt_subtest_with_dynamic("compute-preempt-many") {
> + xe_for_each_engine(xe, hwe) {
> + /*
> + * TODO: Render engine is getting timed out when count is high,
> + * so for now only test with compute engine
> + */
> + if (hwe->engine_class != DRM_XE_ENGINE_CLASS_COMPUTE)
> + continue;
> +
> + igt_dynamic_f("engine-%s", xe_engine_class_string(hwe->engine_class))
> + test_compute_preempt(xe, hwe, 100);
> }
> }
>
next prev parent reply other threads:[~2024-02-27 7:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 19:39 [PATCH i-g-t] tests/intel/xe_compute_preempt: Add compute-preempt-many Nirmoy Das
2024-02-23 21:46 ` ✓ CI.xeBAT: success for " Patchwork
2024-02-23 21:48 ` ✓ Fi.CI.BAT: " Patchwork
2024-02-24 12:38 ` ✓ Fi.CI.IGT: " Patchwork
2024-02-27 7:31 ` Nirmoy Das [this message]
2024-02-27 16:39 ` [PATCH i-g-t] " Zbigniew Kempczyński
2024-02-27 18:22 ` Nirmoy Das
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=fdbd6fa5-fe2d-48e3-acf9-7edc443ae916@linux.intel.com \
--to=nirmoy.das@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=janga.rahul.kumar@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=nirmoy.das@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