On 1/5/26 19:20, Liam R. Howlett wrote: > * Mikulas Patocka <[email protected]> [260104 16:18]: >> 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)) >> + pr_err("%s: Failed to register MMU notifier: %d\n", >> + __func__, ret); > > Masking off error messages will make the message less useful and harder > to debug.
Reporting errors on -EINTR and -ERESTARTSYS are usually considered a bug since that are perfectly normal conditions to occur. > You could also change the log level, which might be more desirable for a > whole lot of the messages in here? Well I agree that debug or info level is probably more suitable, but error messages like this here are just a symptom that people doesn't know how to properly use ftrace. In other words when you have a message in syslog that userspace did something wrong, even if it's just a debug message, than that is in like 99% of all cases not appropriate. What drivers should log is things like HW conditions changes, global SW condition changes because somebody requested feature X, performance changes because of I have to enable workaround Y...... but not system call is interrupted by signal, application is using to much memory or giving invalid values etc.... Regards, Christian. > > Thanks, > Liam
