On 10/5/26 09:44, Christian König wrote:
>> +    int ret = 0;
>
> Please don't initialize return values when it isn't necessary.
>
> Initialize it before the goto.

Done, ret is now declared uninitialized and assigned at the two call
sites before each goto.

For completeness: every path reaching the "if (evicted_bos)"
reschedule check has ret assigned -- the two failure gotos carry the
error, and unlock_notifier_out is only reachable after
update_invalid_user_pages() (and validate_invalid_user_pages() when
the list is non-empty) returned 0. So the concurrent-eviction and
WARN paths still reschedule exactly as before.

>> +                    pr_warn_once("%s: device unplugged, aborting userptr 
>> restore (pid %d, %s)\n",
>
> That warning is most likely unnecessary and maybe even harmful.
>
> That the device is hot removed should just be a perfectly normal
> abortion condition for the worker.

Agreed, dropped entirely. The worker now just skips the reschedule
when ret == -ENODEV, treated as a normal termination condition. This
also correctly suppresses the KFD_SMI_EVENT restore-rescheduled
notification, which would otherwise falsely tell userspace that
another attempt is coming.

v2 follows.

Thanks,
Olivier

Reply via email to