On Mon, 2008-06-16 at 10:24 +0200, Thomas Hellström wrote:

> IMHO this seems like a very odd commit.

We're now using libdrm for all X server device interaction, which means
having every return deal correctly with signals (as the X server
receives a lot of signals). What we want is restartable ioctls, but
POSIX doesn't allow those.

Are there DRM functions which can be interrupted and which shouldn't be
restarted? It seems crazy to me. However, it's likely that we should
only restart on EINTR and not on EAGAIN. EINTR should only be returned
when interrupted by a signal, and restarting makes the ioctls look like
other 'sane' syscalls like read and write.

> If the "wait_event_interruptible" hits a signal, it will return an 
> -ERESTARTSYS.
> In that case no error message should be printed out, and the code should 
> perform all cleanup necessary to be able to restart from the ioctl entry 
> point, and then return an appropriate error message (-EINTR or perhaps 
> -EAGAIN) to user-space. The above code might kill the X server if it 
> hits a mouse-movement signal during the wait.

All users of this path do correctly clean up and return -EINTR from the
kernel; the error message is actually useful precisely when this occurs
as the wait is almost always interrupted when the user hits ^C because
the application has locked up inside this wait.

> Also if a mutex is locked around a long GPU wait, it is preferrable to, 
> when possible (not just around GPU waits) , lock that mutex using
> mutex_lock_interruptible
> with proper error handling, to avoid long signal delivery latencies when 
> a process is waiting uninterruptible for the mutex.

That's a good suggestion; most of the paths in the driver take the mutex
on entrance to the syscall, making the 'cleanup' trivial too.

-- 
[EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to