Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 0/6] Order SR-IOV scheduling provisioning safely
@ 2026-08-18 12:39 Marcin Bernatowicz
  2026-08-18 12:39 ` [PATCH i-g-t 1/6] tests/intel/xe_sriov_scheduling: Disable VFs before resetting sched params Marcin Bernatowicz
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Marcin Bernatowicz @ 2026-08-18 12:39 UTC (permalink / raw)
  To: igt-dev
  Cc: Marcin Bernatowicz, Adam Miszczak, Jakub Kolakowski,
	Lukasz Laguna, Michal Wajdeczko

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 <adam.miszczak@linux.intel.com>
Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-08-18 16:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 12:39 [PATCH i-g-t 0/6] Order SR-IOV scheduling provisioning safely Marcin Bernatowicz
2026-08-18 12:39 ` [PATCH i-g-t 1/6] tests/intel/xe_sriov_scheduling: Disable VFs before resetting sched params Marcin Bernatowicz
2026-08-18 14:14   ` Laguna, Lukasz
2026-08-18 12:39 ` [PATCH i-g-t 2/6] lib/xe/xe_sriov_admin: Rename restore defaults helpers Marcin Bernatowicz
2026-08-18 14:14   ` Laguna, Lukasz
2026-08-18 12:39 ` [PATCH i-g-t 3/6] lib/xe/xe_sriov_admin: Lower priority before clearing timeslicing Marcin Bernatowicz
2026-08-18 14:15   ` Laguna, Lukasz
2026-08-18 12:39 ` [PATCH i-g-t 4/6] lib/xe/xe_sriov_admin: Add bulk scheduling params setter Marcin Bernatowicz
2026-08-18 14:15   ` Laguna, Lukasz
2026-08-18 12:39 ` [PATCH i-g-t 5/6] tests/intel/xe_sriov_scheduling: Use safe scheduling params helpers Marcin Bernatowicz
2026-08-18 14:15   ` Laguna, Lukasz
2026-08-18 12:39 ` [PATCH i-g-t 6/6] tests/intel/xe_pmu: Disable VFs before restoring sched params Marcin Bernatowicz
2026-08-18 14:16   ` Laguna, Lukasz
2026-08-18 14:11 ` ✓ Xe.CI.BAT: success for Order SR-IOV scheduling provisioning safely Patchwork
2026-08-18 14:20 ` ✓ i915.CI.BAT: " Patchwork
2026-08-18 16:39 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox