[PATCH] Allow system call restarts upon signal interruption

Jasper St. Pierre jstpierre at mecheye.net
Tue May 12 20:23:51 PDT 2015


(Resending from the email address I'm subscribed to, sorry for the noise)

I don't see how that's the case. The select() call should never block, see:

http://cgit.freedesktop.org/xorg/xserver/tree/os/connection.c#n1000

>From select(2):

    If both fields of the timeval structure are zero, then select()
returns immediately.

On Tue, May 12, 2015 at 7:18 PM, Michel Dänzer <michel at daenzer.net> wrote:
> On 13.05.2015 07:39, Daniel Drake wrote:
>> The X server frequently deals with SIGIO and SIGALRM interruptions.
>> If process execution is inside certain blocking system calls
>> when these signals arrive, e.g. with the kernel blocked on
>> a contended semaphore, the system calls will be interrupted.
>>
>> Some system calls are automatically restartable (the kernel re-executes
>> them with the same parameters once the signal handler returns) but
>> only if the signal handler allows it.
>>
>> Set SA_RESTART on the signal handlers to enable this convenient
>> behaviour.
>
> The discussion about this on IRC sounded to me like we don't want to do
> this for both signals, because at least one of them should interrupt
> select(). My guess would be that SIGIO should interrupt select() and
> thus shouldn't use SA_RESTART.
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel



-- 
  Jasper


More information about the xorg-devel mailing list