On Sun, Jan 04, 2026 at 10:17:52PM +0100, 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.
> + */
I mean, an error did happen right? It seems reasonable to report that you
couldn't register it because a fatal signal arose, so not sure this adds much
value.
If we really do want to skip reporting it, I agree with Christian, the
fatal_signal_pending() seems superfluous.
So if you want to skip reporting a process killed by fatal signal I'd implement
it as:
if (ret && ret != -EINTR) {
...
}
But I generally think this is fine as-is, a user can see the error was
-EINTR. So I'd drop this patch personally.
> + if (!(fatal_signal_pending(current) && ret == -EINTR))
> + pr_err("%s: Failed to register MMU notifier: %d\n",
> + __func__, ret);
> goto out;
> }
>
>
>