[Intel-xe] [RFC PATCH 0/2] Implement vma madvise ioctl

Nirmoy Das nirmoy.das at linux.intel.com
Wed May 24 20:12:44 UTC 2023


On 5/24/2023 8:30 PM, Matthew Brost wrote:
> On Wed, May 24, 2023 at 02:36:46PM +0200, Nirmoy Das wrote:
>> Sending this initial RFC patch series for vma madvise ioctl
>> to gether feedback if this the correct way to do that.
>>
>> I am adding two expected options for userspace to pass
>>
>> DRM_XE_VMA_MADVISE_WILLNEED:
>> 	* Set ttm priority to normal/high(if cap permits)
>> 	* Make sure VMAs are in allowed placement and bound.
>>
>> DRM_XE_VMA_MADVISE_DONTNEED:
>> 	* Set ttm priority to low so the BO belong to the vma
>> 	become early target for eviction.
>> 	* Make sure VMAs are not bound.
>>
>> Questions:
>> Should this be part of DRM_IOCTL_XE_VM_MADVISE rather than creating new ioctl?
>>
> Def not a new IOCTL. Let's take a step back, what are you trying to
> implement that the current DRM_IOCTL_XE_VM_MADVISE IOCTL / VM bind IOCTL
> does not support?

AFAIU at this moment:

MADVISE_WILLNEED  ==  XE_VM_BIND_OP_PREFETCH + DRM_XE_VM_MADVISE_PRIORITY
MADVISE_DONTNEED  ==  XE_VM_BIND_OP_UNMAP + DRM_XE_VM_MADVISE_PRIORITY

So unless we need explicit madvise ioctl or vm_madvise ioctl options for UMD,
I think we can have madvise equivalent with above vm bind and vm madvise ioctl.

Hi Thomas, Joonas,

What do you think ?


Regards,

Nirmoy

>
> Matt
>
>> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
>> Cc: Matthew Brost <matthew.brost at intel.com>
>>
>> Nirmoy Das (2):
>>    drm/xe: Expose vma bind-unbind functions
>>    drm/xe: Implement madvise ioctl for vma
>>
>>   drivers/gpu/drm/xe/Makefile         |   1 +
>>   drivers/gpu/drm/xe/xe_device.c      |   2 +
>>   drivers/gpu/drm/xe/xe_vm.c          |  52 +++----
>>   drivers/gpu/drm/xe/xe_vm.h          |   3 +
>>   drivers/gpu/drm/xe/xe_vma_madvise.c | 223 ++++++++++++++++++++++++++++
>>   drivers/gpu/drm/xe/xe_vma_madvise.h |  15 ++
>>   include/uapi/drm/xe_drm.h           |  28 ++++
>>   7 files changed, 296 insertions(+), 28 deletions(-)
>>   create mode 100644 drivers/gpu/drm/xe/xe_vma_madvise.c
>>   create mode 100644 drivers/gpu/drm/xe/xe_vma_madvise.h
>>
>> -- 
>> 2.39.0
>>


More information about the Intel-xe mailing list