Skip to contentSkip to conversation

Ctrl+C doesn't interrupt process waiting for I/O

DISCUSSION Matthew Wilcox 1 participant 1 message Jul 3, 2008

lore
Share & tools
lore
#0 lore raw

I'd like to correct a few misapprehensions in this thread. To be fair, what they were saying used to be true, but it isn't any more, and I would like people to be aware of it.

Quoted 3 lines · Avi Kivity

That's filesystem dependent; if you mount an nfs filesystem with the 'intr' mount option, it will be interruptible (which makes sense, as it is impossible to guarantee the server's responsiveness).

As of v2.6.25, 'intr' is a no-op. The option is still recognised, but it does not change NFS's behaviour.

Quoted 4 lines · Bill Davidson

Basic problem is that you can get a process which you can't interrupt (in in most cases can't kill) which has resources tied up. Given the choice between surprising a process with an EINTR or killing it during a reboot to get the system usable again, I would rather surprise.

I implemented option C (none of the above). NFS now sleeps in state TASK_KILLABLE so tasks can be killed, but they will never see the -EINTR return (since they're dead). Yes, that means you can end up with a partial write to a file on the server. But if you tripped over the (power/network) cable, that could happen anyway.

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."