On 6/12/26 15:20, Huang, Honglei wrote:
> On 6/12/2026 8:02 PM, Christian König wrote:
>> On 6/12/26 11:09, Huang Rui wrote:
>>> From: Honglei Huang <[email protected]>
...
>>> +static inline void amdgpu_svm_assert_locked(struct amdgpu_svm *svm)
>>> +{
>>> +    lockdep_assert_held_write(&svm->svm_lock);
>>> +}
>>
>> What exactly is that lock protecting?
>>
> 
> this lock is the driver_svm_lock required by the drm_gpusvm framework
> It is registered by drm_gpusvm_driver_set_lock(), and drm_gpusvm lockdep 
> asserts it on every structural entry point, e.g.
> drm_gpusvm_range_find_or_insert() / drm_gpusvm_range_remove().
> 
> Per amdgpu_svm it serializes the write/commit side against the fault
> handler: range/notifier tree insert+remove, attribute changes, and the
> garbage collector.
> 
> This is the same thing xe does, in drivers/gpu/drm/xe/xe_svm.c:
> 
> drm_gpusvm_driver_set_lock(&vm->svm.gpusvm, &vm->lock);

This is clearly incorrect in that case. Our equivalent in amdgpu is 
vm->eviction_lock.

That was already completely incorrect in the old KFD implementation, please 
don't use that one as blueprint.

Regards,
Christian.

Reply via email to