Skip to content

Commit 6f0f404

Browse files
mbrost05Thomas Hellström
authored andcommitted
drm/xe: Adjust long-running workload timeslices to reasonable values
A 10ms timeslice for long-running workloads is far too long and causes significant jitter in benchmarks when the system is shared. Adjust the value to 5ms for preempt-fencing VMs, as the resume step there is quite costly as memory is moved around, and set it to zero for pagefault VMs, since switching back to pagefault mode after dma-fence mode is relatively fast. Also change min_run_period_ms to 'unsiged int' type rather than 's64' as only positive values make sense. Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: stable@vger.kernel.org Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/20251212182847.1683222-2-matthew.brost@intel.com (cherry picked from commit 33a5abd) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent f8dd66b commit 6f0f404

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,10 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags, struct xe_file *xef)
15081508
INIT_WORK(&vm->destroy_work, vm_destroy_work_func);
15091509

15101510
INIT_LIST_HEAD(&vm->preempt.exec_queues);
1511-
vm->preempt.min_run_period_ms = 10; /* FIXME: Wire up to uAPI */
1511+
if (flags & XE_VM_FLAG_FAULT_MODE)
1512+
vm->preempt.min_run_period_ms = 0;
1513+
else
1514+
vm->preempt.min_run_period_ms = 5;
15121515

15131516
for_each_tile(tile, xe, id)
15141517
xe_range_fence_tree_init(&vm->rftree[id]);

drivers/gpu/drm/xe/xe_vm_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ struct xe_vm {
263263
* @min_run_period_ms: The minimum run period before preempting
264264
* an engine again
265265
*/
266-
s64 min_run_period_ms;
266+
unsigned int min_run_period_ms;
267267
/** @exec_queues: list of exec queues attached to this VM */
268268
struct list_head exec_queues;
269269
/** @num_exec_queues: number exec queues attached to this VM */

0 commit comments

Comments
 (0)