[PATCH 1/3] drm/amdkfd: add new flags for svm

Eric Huang jinhuieric.huang at amd.com
Tue Jun 28 20:53:12 UTC 2022


Thank you, Felix.

I will send all libhsakmt changes and amdkfd changes to amd-gfx.

Regards,
Eric

On 2022-06-28 16:44, Felix Kuehling wrote:
> Am 2022-06-27 um 12:01 schrieb Eric Huang:
>> No. There is only internal link for now, because it is under review. 
>> Once it is submitted, external link should be in gerritgit for 
>> libhsakmt.
>
> Hi Eric,
>
> For anything that requires ioctl API changes, the user mode and kernel 
> mode changes need to be reviewed together in public. You can either 
> post the libhsakmt change by email to amd-gfx, or you can push your 
> libhsakmt development branch to a personal branch on github and 
> include a link to that in the kernel commit description.
>
> Alex, some background about this series: We are looking into using 
> unified memory for CWSR context save space. This allows us to get 
> lower preemption latency when VRAM is available, but migrate it to 
> system memory when more VRAM is needed for application allocations. 
> Because we cannot preempt in the trap handler, and we want to 
> guarantee finite time for preemption and trap handler execution, we 
> need to prevent page faults on any memory accessed by the trap 
> handler. The KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED flag is meant to 
> guarantee that.
>
> I think the KFD_IOCTL_SVM_FLAG_CUSTOM is not necessary. I've responded 
> to Eric with an alternative idea.
>
> Regards,
>   Felix
>
>
>>
>> Regards,
>> Eric
>>
>> On 2022-06-27 11:58, Alex Deucher wrote:
>>> On Mon, Jun 27, 2022 at 11:36 AM Eric Huang 
>>> <jinhuieric.huang at amd.com> wrote:
>>>> http://gerrit-git.amd.com/c/compute/ec/libhsakmt/+/697296
>>> Got an external link?
>>>
>>> Alex
>>>
>>>> Regards,
>>>> Eric
>>>>
>>>> On 2022-06-27 11:33, Alex Deucher wrote:
>>>>> On Fri, Jun 24, 2022 at 12:03 PM Eric Huang 
>>>>> <jinhuieric.huang at amd.com> wrote:
>>>>>> It is to add new options for always keeping gpu mapping
>>>>>> and custom of coarse grain allocation intead of fine
>>>>>> grain as default.
>>>>>>
>>>>>> Signed-off-by: Eric Huang <jinhuieric.huang at amd.com>
>>>>> Can you provide a link to the proposed userspace for this?
>>>>>
>>>>> Alex
>>>>>
>>>>>> ---
>>>>>>    include/uapi/linux/kfd_ioctl.h | 4 ++++
>>>>>>    1 file changed, 4 insertions(+)
>>>>>>
>>>>>> diff --git a/include/uapi/linux/kfd_ioctl.h 
>>>>>> b/include/uapi/linux/kfd_ioctl.h
>>>>>> index fd49dde4d5f4..9dbf215675a0 100644
>>>>>> --- a/include/uapi/linux/kfd_ioctl.h
>>>>>> +++ b/include/uapi/linux/kfd_ioctl.h
>>>>>> @@ -1076,6 +1076,10 @@ struct kfd_ioctl_cross_memory_copy_args {
>>>>>>    #define KFD_IOCTL_SVM_FLAG_GPU_EXEC    0x00000010
>>>>>>    /* GPUs mostly read, may allow similar optimizations as RO, 
>>>>>> but writes fault */
>>>>>>    #define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020
>>>>>> +/* Keep GPU memory mapping always valid as if XNACK is disable */
>>>>>> +#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED 0x00000040
>>>>>> +/* Allow set custom flags instead of defaults */
>>>>>> +#define KFD_IOCTL_SVM_FLAG_CUSTOM      0x80000000
>>>>>>
>>>>>>    /**
>>>>>>     * kfd_ioctl_svm_op - SVM ioctl operations
>>>>>> -- 
>>>>>> 2.25.1
>>>>>>
>>



More information about the amd-gfx mailing list