On Tue, Dec 20, 2005 at 17:10:06 +0700, Mulyadi Santosa wrote: > [...] > > Such syscalls return -EINTR, -ERESTARTSYS, -ERESTARTNOINTR or > > -ERESTARTNOHAND (see linux/errno.h). The first is simply returned to > > userland as errno value (eg. select and poll do this), the other > > three tell the signal trampoline to restart the syscall. Note that > > non-local exit from signal handler bypasses this trampoline, so the > > kernel never knows for sure whether the signal will be restarted or > > not. > > I don't understand, what do you mean by non-local exit? Non-local exit is any other exit but return. That is longjmp and exception in C++. Though I am not sure throwing exception from signal handler will do anything sane. > [...] > About the uninterruptible state, that's why I suggest Toni to take a > deep look on how sock_recvmsg() works, does it put the process in > interruptible state or the uninterruptible one. It has two points where it can sleep. One is the recv method and the other is the wait_on_sync_kiocb. The first one can do different things for different kinds of sockets, but for tcp socket it does interruptible sleep. The later does uninterruptible sleep. By the way I believe there is a subtle bug in wait_on_sync_kiocb. If the process is preempted both just before and just after the set_current_state in fs/aio.c line 317 and during the first preemption the io completes, AFAICT the process will not wake up. I think one of the tests should be tied to the state setting with preempt_disable/preempt_enable. -- Jan 'Bulb' Hudec <bulb@xxxxxx>
Attachment:
signature.asc
Description: Digital signature