[Intel-xe] [PATCH 4/7] drm/xe: Record each drm client with its VM
Upadhyay, Tejas
tejas.upadhyay at intel.com
Thu Sep 7 08:49:44 UTC 2023
From: Ghimiray, Himal Prasad <himal.prasad.ghimiray at intel.com>
Sent: Wednesday, September 6, 2023 3:18 PM
To: Upadhyay, Tejas <tejas.upadhyay at intel.com>; intel-xe at lists.freedesktop.org
Cc: Iddamsetty, Aravind <aravind.iddamsetty at intel.com>
Subject: Re: [PATCH 4/7] drm/xe: Record each drm client with its VM
On 31-08-2023 14:35, Tejas Upadhyay wrote:
Enable accounting of indirect client memory usage.
Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com><mailto:tejas.upadhyay at intel.com>
---
drivers/gpu/drm/xe/xe_vm.c | 1 +
drivers/gpu/drm/xe/xe_vm_types.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 9cbf2f63d641..f5f832c8ed42 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -2057,6 +2057,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
}
args->vm_id = id;
+ vm->xef = xef;
shouldn't it be applicable only if CONFIG_PROC_FS is enabled ?
Tracking VM is not dependent on proc fs so it does not give relation. Adding bo and FDINFO read/parse is only dependent on procfs otherwise dummy calls. So I do not think it is necessary. Please let me know if you think otherwise.
Thanks,
Tejas
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEM)
/* Warning: Security issue - never enable by default */
diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h
index fd2178dbde3a..db8523d81d0f 100644
--- a/drivers/gpu/drm/xe/xe_vm_types.h
+++ b/drivers/gpu/drm/xe/xe_vm_types.h
@@ -336,6 +336,8 @@ struct xe_vm {
/** @batch_invalidate_tlb: Always invalidate TLB before batch start */
bool batch_invalidate_tlb;
+ /** @xef: XE file handle for tracking this VM's drm client */
+ struct xe_file *xef;
Same comment as above.
};
/** struct xe_vma_op_map - VMA map operation */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-xe/attachments/20230907/3ad75f1a/attachment.htm>
More information about the Intel-xe
mailing list