Skip to content

Commit

Permalink
drm/xe: Add modparam for SVM notifier size
Browse files Browse the repository at this point in the history
Useful to experiment with notifier size and how it affects performance.

v3:
 - Pull missing changes including in following patch (Thomas)
v5:
 - Spell out power of 2 (Thomas)

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306012657.3505757-31-matthew.brost@intel.com
  • Loading branch information
Matthew Brost committed Mar 6, 2025
1 parent d92eabb commit 8e5a5dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/xe/xe_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ struct xe_modparam xe_modparam = {
.guc_log_level = 3,
.force_probe = CONFIG_DRM_XE_FORCE_PROBE,
.wedged_mode = 1,
.svm_notifier_size = 512,
/* the rest are 0 by default */
};

module_param_named(svm_notifier_size, xe_modparam.svm_notifier_size, uint, 0600);
MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier size(in MiB), must be power of 2");

module_param_named_unsafe(force_execlist, xe_modparam.force_execlist, bool, 0444);
MODULE_PARM_DESC(force_execlist, "Force Execlist submission");

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/xe/xe_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct xe_modparam {
unsigned int max_vfs;
#endif
int wedged_mode;
u32 svm_notifier_size;
};

extern struct xe_modparam xe_modparam;
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/xe/xe_svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "xe_bo.h"
#include "xe_gt_tlb_invalidation.h"
#include "xe_migrate.h"
#include "xe_module.h"
#include "xe_pt.h"
#include "xe_svm.h"
#include "xe_ttm_vram_mgr.h"
Expand Down Expand Up @@ -607,7 +608,8 @@ int xe_svm_init(struct xe_vm *vm)

err = drm_gpusvm_init(&vm->svm.gpusvm, "Xe SVM", &vm->xe->drm,
current->mm, xe_svm_devm_owner(vm->xe), 0,
vm->size, SZ_512M, &gpusvm_ops, fault_chunk_sizes,
vm->size, xe_modparam.svm_notifier_size * SZ_1M,
&gpusvm_ops, fault_chunk_sizes,
ARRAY_SIZE(fault_chunk_sizes));
if (err)
return err;
Expand Down

0 comments on commit 8e5a5dc

Please sign in to comment.