lkml.org 
[lkml]   [2008]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Ctrl+C doesn't interrupt process waiting for I/O
From
Date
Jeremy Fitzhardinge <jeremy@goop.org> writes:

>> I have encountered the following situation several times, but I've been
>> unable to come up with a way to reproduce this until now:
>> - some process is keeping the disk busy (some cron job for example:
>> updatedb, chkrootkit, ...)
>> - other processes that want to do I/O have to wait (this is normal)
>> - I have a (I/O bound) process running in my terminal, and I want to
>> interrupt it with Ctrl+C
>> - I type Ctrl+C several times, and the process is not interrupted for
>> several seconds (10-30 secs)
>> - if I type Ctrl+Z, and use kill %1 the process dies faster than
>> waiting for it to react to Ctrl+C
>>
>> This issue occurs both on my x86-64 machine that uses reiserfs, and on
>> my x86 machine that uses XFS, so it doesn't seem related to the
>> underlying FS.
>> I use 2.6.25-2 and 2.6.26-rc8 now; I don't recall seeing this behaviour
>> with old kernels (IIRC I see this since 2.6.21 or 2.6.23).
>>
>> Is this intended behaviour, or should I report a bug?
>>
>
> Yes, it's intended behaviour. Filesystem IO syscalls are considered
> "fast" and are interruptible. Usermode code can reasonably expect
> that file IO will never return EINTR.
>
> That said, if a program is blocking for tens of seconds in block IO,
> then that could be a problem in itself.

Still there's the effect that Ctrl-Z+kill works faster than Ctrl-C
that is not explained by this. This has often annoyed me too.
I'm not sure why it is. In theory they should be the same unless
someone blocks SIGINT.

-Andi


\
 
 \ /
  Last update: 2008-06-29 14:13    [W:0.131 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site