From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
Adam Miszczak <adam.miszczak@linux.intel.com>,
Jakub Kolakowski <jakub1.kolakowski@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Lukasz Laguna <lukasz.laguna@intel.com>,
Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Subject: [PATCH v2 i-g-t 3/3] tests/intel/xe_sriov_scheduling: Make in-flight submissions configurable
Date: Tue, 19 Aug 2025 18:50:45 +0200 [thread overview]
Message-ID: <20250819165045.467613-4-marcin.bernatowicz@linux.intel.com> (raw)
In-Reply-To: <20250819165045.467613-1-marcin.bernatowicz@linux.intel.com>
Allow controlling (or auto-selecting) the number of concurrent
submissions per VF to better saturate hardware, especially for short
jobs.
- Add --inflight option; 0 = auto (default), >=1 = explicit K.
- Select K via a small heuristic (non-preempt: 1; <=12ms: 4; <=20ms: 3;
else 2).
- Plumb K into subm_init() and print inflight=K in the banner.
- Relax minimums to support short jobs: MIN_EXEC_QUANTUM_MS=1,
MIN_JOB_DURATION_MS=2.
- Update CLI parsing and help text.
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Adam Miszczak <adam.miszczak@linux.intel.com>
Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
---
tests/intel/xe_sriov_scheduling.c | 55 ++++++++++++++++++++++++++-----
1 file changed, 46 insertions(+), 9 deletions(-)
diff --git a/tests/intel/xe_sriov_scheduling.c b/tests/intel/xe_sriov_scheduling.c
index 97263cbd2..2fc78f570 100644
--- a/tests/intel/xe_sriov_scheduling.c
+++ b/tests/intel/xe_sriov_scheduling.c
@@ -27,6 +27,8 @@ struct subm_opts {
uint32_t exec_quantum_ms;
uint32_t preempt_timeout_us;
double outlier_treshold;
+ /* --inflight=0 => auto; >=1 => explicit K */
+ unsigned int inflight;
};
struct subm_work_desc {
@@ -496,9 +498,9 @@ static void log_sample_values(char *id, struct subm_stats *stats,
}
#define MIN_NUM_REPEATS 25
-#define MIN_EXEC_QUANTUM_MS 8
+#define MIN_EXEC_QUANTUM_MS 1
#define MAX_EXEC_QUANTUM_MS 32
-#define MIN_JOB_DURATION_MS 16
+#define MIN_JOB_DURATION_MS 2
#define MAX_TOTAL_DURATION_MS 15000
#define PREFERRED_TOTAL_DURATION_MS 10000
#define MAX_PREFERRED_REPEATS 100
@@ -570,6 +572,25 @@ static int adjust_num_repeats(int duration_ms, int num_threads)
return max(optimal_repeats, MIN_NUM_REPEATS);
}
+/* inflight K selection:
+ * user_k == 0 => auto
+ * user_k >= 1 => explicit K
+ */
+static unsigned int select_inflight_k(unsigned int duration_ms,
+ unsigned int user_k,
+ bool nonpreempt)
+{
+ if (user_k)
+ return user_k >= 1 ? user_k : 1;
+ if (nonpreempt)
+ return 1;
+ if (duration_ms <= 12)
+ return 4;
+ if (duration_ms <= 20)
+ return 3;
+ return 2;
+}
+
static struct vf_sched_params prepare_vf_sched_params(int num_threads,
int min_num_repeats,
int job_timeout_ms,
@@ -630,12 +651,14 @@ static void throughput_ratio(int pf_fd, int num_vfs, const struct subm_opts *opt
struct job_sched_params job_sched_params = prepare_job_sched_params(num_vfs + 1,
job_timeout_ms,
opts);
+ const unsigned int k = select_inflight_k(job_sched_params.duration_ms,
+ opts->inflight, false);
- igt_info("eq=%ums pt=%uus duration=%ums repeats=%d num_vfs=%d job_timeout=%ums\n",
+ igt_info("eq=%ums pt=%uus duration=%ums repeats=%d inflight=%u num_vfs=%d job_timeout=%ums\n",
job_sched_params.sched_params.exec_quantum_ms,
job_sched_params.sched_params.preempt_timeout_us,
job_sched_params.duration_ms, job_sched_params.num_repeats,
- num_vfs + 1, job_timeout_ms);
+ k, num_vfs + 1, job_timeout_ms);
init_vf_ids(vf_ids, ARRAY_SIZE(vf_ids),
&(struct init_vf_ids_opts){ .shuffle = true,
@@ -664,7 +687,7 @@ static void throughput_ratio(int pf_fd, int num_vfs, const struct subm_opts *opt
igt_assert_fd(vf_fd);
set->data[n].opts = opts;
subm_init(&set->data[n].subm, vf_fd, vf_ids[n], 0,
- xe_engine(vf_fd, 0)->instance, 1);
+ xe_engine(vf_fd, 0)->instance, k);
subm_workload_init(&set->data[n].subm,
&(struct subm_work_desc){
.duration_ms = job_sched_params.duration_ms,
@@ -729,10 +752,11 @@ static void nonpreempt_engine_resets(int pf_fd, int num_vfs,
vf_sched_params.preempt_timeout_us / USEC_PER_MSEC;
int preemptible_end = 1;
uint8_t vf_ids[num_vfs + 1 /*PF*/];
+ const unsigned int k = select_inflight_k(duration_ms, opts->inflight, true);
- igt_info("eq=%ums pt=%uus duration=%" PRIu64 "ms num_vfs=%d job_timeout=%ums\n",
+ igt_info("eq=%ums pt=%uus duration=%" PRIu64 "ms inflight=%u num_vfs=%d job_timeout=%ums\n",
vf_sched_params.exec_quantum_ms, vf_sched_params.preempt_timeout_us,
- duration_ms, num_vfs, job_timeout_ms);
+ duration_ms, k, num_vfs, job_timeout_ms);
init_vf_ids(vf_ids, ARRAY_SIZE(vf_ids),
&(struct init_vf_ids_opts){ .shuffle = true,
@@ -761,7 +785,7 @@ static void nonpreempt_engine_resets(int pf_fd, int num_vfs,
igt_assert_fd(vf_fd);
set->data[n].opts = opts;
subm_init(&set->data[n].subm, vf_fd, vf_ids[n], 0,
- xe_engine(vf_fd, 0)->instance, 1);
+ xe_engine(vf_fd, 0)->instance, k);
subm_workload_init(&set->data[n].subm,
&(struct subm_work_desc){
.duration_ms = duration_ms,
@@ -799,6 +823,7 @@ static void nonpreempt_engine_resets(int pf_fd, int num_vfs,
static struct subm_opts subm_opts = {
.sync_method = SYNC_BARRIER,
.outlier_treshold = 0.1,
+ .inflight = 0,
};
static bool extended_scope;
@@ -825,6 +850,16 @@ static int subm_opts_handler(int opt, int opt_index, void *data)
subm_opts.outlier_treshold = atoi(optarg) / 100.0;
igt_info("Outlier threshold: %.2f\n", subm_opts.outlier_treshold);
break;
+ case 'i': {
+ int val = atoi(optarg);
+
+ subm_opts.inflight = val > 0 ? val : 0;
+ if (subm_opts.inflight)
+ igt_info("In-flight submissions: %u\n", subm_opts.inflight);
+ else
+ igt_info("In-flight submissions: auto (0)\n");
+ break;
+ }
default:
return IGT_OPT_HANDLER_ERROR;
}
@@ -838,6 +873,7 @@ static const struct option long_opts[] = {
{ .name = "threshold", .has_arg = true, .val = 't', },
{ .name = "eq_ms", .has_arg = true, .val = 'q', },
{ .name = "pt_us", .has_arg = true, .val = 'p', },
+ { .name = "inflight", .has_arg = true, .val = 'i', },
{}
};
@@ -846,7 +882,8 @@ static const char help_str[] =
" --sync\tThreads synchronization method: 0 - none 1 - barrier (Default 1)\n"
" --threshold\tSample outlier threshold (Default 0.1)\n"
" --eq_ms\texec_quantum_ms\n"
- " --pt_us\tpreempt_timeout_us\n";
+ " --pt_us\tpreempt_timeout_us\n"
+ " --inflight\tNumber of submissions kept in flight per VF (0=auto)\n";
igt_main_args("", long_opts, help_str, subm_opts_handler, NULL)
{
--
2.31.1
next prev parent reply other threads:[~2025-08-19 16:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 16:50 [PATCH v2 i-g-t 0/3] tests/intel/xe_sriov_scheduling: Refactor submission/measurement Marcin Bernatowicz
2025-08-19 16:50 ` [PATCH v2 i-g-t 1/3] tests/intel/xe_sriov_scheduling: Keep K submissions in flight Marcin Bernatowicz
2025-08-22 12:46 ` Laguna, Lukasz
2025-08-19 16:50 ` [PATCH v2 i-g-t 2/3] tests/intel/xe_sriov_scheduling: Compute throughput from completion timestamps Marcin Bernatowicz
2025-08-22 13:44 ` Laguna, Lukasz
2025-08-25 7:31 ` Bernatowicz, Marcin
2025-08-19 16:50 ` Marcin Bernatowicz [this message]
2025-08-22 13:59 ` [PATCH v2 i-g-t 3/3] tests/intel/xe_sriov_scheduling: Make in-flight submissions configurable Laguna, Lukasz
2025-08-19 17:54 ` ✓ i915.CI.BAT: success for tests/intel/xe_sriov_scheduling: Refactor submission/measurement Patchwork
2025-08-19 18:28 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-20 4:44 ` ✗ i915.CI.Full: failure " Patchwork
2025-08-20 13:52 ` ✗ Xe.CI.Full: " 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=20250819165045.467613-4-marcin.bernatowicz@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=adam.miszczak@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=lukasz.laguna@intel.com \
--cc=satyanarayana.k.v.p@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