drm/xe: Add debug messages for MMU notifier and VMA invalidate
authorMatthew Brost <matthew.brost@intel.com>
Wed, 20 Mar 2024 19:42:32 +0000 (12:42 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 21 Mar 2024 17:55:43 +0000 (10:55 -0700)
Extra debug is useful when working on VM issues.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240320194232.1910688-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_vm.c

index 80d43d75b1da86e729f545cc42ac21635938a341..e3692b7e1711e96bdd34e07c02ffcdc3cd60e0f3 100644 (file)
@@ -648,6 +648,10 @@ static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,
        if (!mmu_notifier_range_blockable(range))
                return false;
 
+       vm_dbg(&xe_vma_vm(vma)->xe->drm,
+              "NOTIFIER: addr=0x%016llx, range=0x%016llx",
+               xe_vma_start(vma), xe_vma_size(vma));
+
        down_write(&vm->userptr.notifier_lock);
        mmu_interval_set_seq(mni, cur_seq);
 
@@ -3233,6 +3237,10 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
        xe_assert(xe, !xe_vma_is_null(vma));
        trace_xe_vma_invalidate(vma);
 
+       vm_dbg(&xe_vma_vm(vma)->xe->drm,
+              "INVALIDATE: addr=0x%016llx, range=0x%016llx",
+               xe_vma_start(vma), xe_vma_size(vma));
+
        /* Check that we don't race with page-table updates */
        if (IS_ENABLED(CONFIG_PROVE_LOCKING)) {
                if (xe_vma_is_userptr(vma)) {