On Tue, 6 Jan 2026, Pedro Falcato wrote:

> On Tue, Jan 06, 2026 at 09:19:59PM +0100, Mikulas Patocka wrote:
> > 
> > 
> > On Tue, 6 Jan 2026, Liam R. Howlett wrote:
> > 
> > > Okay, so the other call paths also end up getting the -EINTR from this
> > > function?  Can you please add that detail to the commit message?
> > 
> > Yes. I'd like to ask the GPU people to look at it and say how much damage 
> > this -EINTR could do. I don't know - I just saw the messages "Failed to 
> > register MMU notifier: -4" in the syslog.

I read the ROCm source code and it seems to restart all ioctls on EINTR or 
EAGAIN correctly.

So, this syslog message is harmless.

The only problem is that open() is not restarted (even if the signal has 
the SA_RESTART flag).

> > > Any other -EINTR system call will also cause you problems since you
> > > continuously send signals to your process, so we'll have to change them
> > > all for this to work?
> > 
> > I use SA_RESTART for the signals. And I retry all the syscalls on EINTR 
> > just in case SA_RESTART didn't work. So, I don't experience random 
> > failures in my code due to the periodic signal.
> > 
> > But there is code that I have no control over - such as the OpenCL shared 
> > library.
> 
> Right. So I am wondering if just returning -ERESTARTSYS (whether in
> mm_take_all_locks(), or in the AMD driver) would satisfy both parties.
> 
> Folks installing and using signals need to pay attention and set
> SA_RESTART, but that's already best practice when dealing with third-party
> code. open(2) should be transparently restartable.
> 
> WDYT?

I tested it with -ERESTARTSYS and it works. I get the messages 
"init_user_pages: Failed to register MMU notifier: -512" in the syslog - 
but that is benign.

Mikulas

Reply via email to