Skip to content

Order SR-IOV scheduling provisioning safely

Marcin Bernatowicz igt-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6tests/intel/xe_sriov_scheduling: Disable VFs before resetting sched paramstests/intel/xe_sriov_scheduling.c+3 -31 reply
2/6lib/xe/xe_sriov_admin: Rename restore defaults helperslib/xe/xe_sriov_admin.c lib/xe/xe_sriov_admin.h tests/intel/xe_pmu.c +2 more+24 -241 reply
3/6lib/xe/xe_sriov_admin: Lower priority before clearing timeslicinglib/xe/xe_sriov_admin.c+20 -121 reply
4/6lib/xe/xe_sriov_admin: Add bulk scheduling params setterlib/xe/xe_sriov_admin.c lib/xe/xe_sriov_admin.h+73 -01 reply
5/6tests/intel/xe_sriov_scheduling: Use safe scheduling params helperstests/intel/xe_sriov_scheduling.c+23 -631 reply
6/6tests/intel/xe_pmu: Disable VFs before restoring sched paramstests/intel/xe_pmu.c+1 -11 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchLukasz Laguna
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH i-g-t 0/6] Order SR-IOV scheduling provisioning safely

Provisioning execution quantum, preemption timeout and scheduling priority is not order independent. Zero execution quantum and zero preemption timeout both mean infinity, and a function left at a priority above LOW with infinite timeslicing may never be switched away from by GuC. That is a risky state which can be left via PAUSE/FLR, so the safe sequences are:

setup: exec_quantum, preempt_timeout, sched_priority
cleanup: sched_priority (LOW), exec_quantum (0), preempt_timeout (0)

The restore helpers in lib did the opposite on cleanup, clearing timeslicing first and dropping priority last. That transits through the risky state whenever a test raised priority, and is reachable from xe_pmu, which restores defaults while VFs are still enabled, and from the SR-IOV exit handler on abort or signal.

Scheduling parameters should also only be reset once VFs are disabled, since resetting them while VFs are still active can leave cleanup incomplete and make subsequent VF probing fail.

Patch 1 was posted standalone before and is included here because the rest of the series builds on it. Patch 2 renames the restore helpers to say scheduling defaults, since they never touched resource provisioning. Patch 3 is the ordering fix itself and stands on its own. Patch 4 adds a bulk setter enforcing the setup order and rejecting infinite timeslicing, so the invalid combination is unrepresentable rather than merely avoided by convention. Patches 5 and 6 move the tests over, and align xe_pmu cleanup with xe_sriov_scheduling.

Assisted-by Copilot:Claude-Opus-5
Cc Adam Miszczak <[email protected]>
Cc Jakub Kolakowski <[email protected]>
Cc Lukasz Laguna <[email protected]>
Cc Michal Wajdeczko <[email protected]>

Marcin Bernatowicz (6):
tests/intel/xe_sriov_scheduling: Disable VFs before resetting sched
params
lib/xe/xe_sriov_admin: Rename restore defaults helpers lib/xe/xe_sriov_admin: Lower priority before clearing timeslicing lib/xe/xe_sriov_admin: Add bulk scheduling params setter tests/intel/xe_sriov_scheduling: Use safe scheduling params helpers tests/intel/xe_pmu: Disable VFs before restoring sched params

 lib/xe/xe_sriov_admin.c           | 111 +++++++++++++++++++++++-------
 lib/xe/xe_sriov_admin.h           |  32 +++++++--
 tests/intel/xe_pmu.c              |   4 +-
 tests/intel/xe_sriov_admin.c      |   4 +-
 tests/intel/xe_sriov_scheduling.c |  88 +++++++----------------
 5 files changed, 140 insertions(+), 99 deletions(-)
Signature · 1 line
2.43.0