Re: wait_event_interruptible() seems non-atomic
From: Manfred Spraul
Date: Sat Nov 20 2004 - 13:32:39 EST
Jan Engelhardt wrote:
For example the use of down_interruptible() looks wrong to me, I'd use
plain down().
I'd like to be able to hit Ctrl+C (in the userspace application) whenever
possible. If that's not a reason, blame the book
http://www.xml.com/ldd/chapter/book/ch03.html#t8 ("the read method" a further
down below)
As far as I can see BufferLock is only held for tiny sections - the
longest thing is a copy_to_user(), i.e. at worst a swap in. I my opinion
the delay for handling Ctrl+C is therefore negligible and not worth the
added code for handling down_interruptible().
You have already written the code, so I'd leave it as it is and I'll
blame the book. They probably started from an older version of
fs/pipe.c, which contained _interruptible calls. There are gone now,
this allowed some cleanup.
--
Manfred
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/