On 1/4/26 22:17, Mikulas Patocka wrote:
> If the process was killed by a fatal signal, amdgpu_hmm_register could
> return -EINTR (the -EINTR comes from mm_take_all_locks).
>
> Don't log the error in this case, because no error happened.
>
> Signed-off-by: Mikulas Patocka <[email protected]>
>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> Index: mm/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> ===================================================================
> --- mm.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 2026-01-04
> 21:19:14.000000000 +0100
> +++ mm/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 2026-01-04
> 21:19:14.000000000 +0100
> @@ -1070,8 +1070,13 @@ static int init_user_pages(struct kgd_me
>
> ret = amdgpu_hmm_register(bo, user_addr);
> if (ret) {
> - pr_err("%s: Failed to register MMU notifier: %d\n",
> - __func__, ret);
> + /*
> + * If we got EINTR because the process was killed, don't report
> + * it, because no error happened.
> + */
> + if (!(fatal_signal_pending(current) && ret == -EINTR))
The usually approach is to check the return value only.
> + pr_err("%s: Failed to register MMU notifier: %d\n",
> + __func__, ret);
But in this particular case just remove the pr_err(), it seems completely
superfluous to me.
The only reasonable user error here is that we run out of memory and that is
noted in syslog quite extensively anyway.
Regards,
Christian.
> goto out;
> }
>
>