Re: [patch rfc] towards supporting O_NONBLOCK on regular files
From: Stephen C. Tweedie
Date: Mon Oct 11 2004 - 16:55:36 EST
Hi,
On Mon, 2004-10-11 at 19:58, Jeff Moyer wrote:
> sct> I think it's worth getting this right in the long term, though.
> sct> Getting readahead of indirect blocks right has other benefits too ---
> sct> eg. we may be able to fix the situation where we end up trying to read
> sct> indirect blocks before we've even submitted the IO for the previous
> sct> data blocks, breaking the IO pipeline ordering.
>
> So for the short term, are you an advocate of the patch posted?
In the short term, can't we just disable readahead for O_NONBLOCK? That
has true non-blocking semantics --- if the data is already available we
return it, but if not, it's up to somebody else to retrieve it.
That's exactly what you want if you're genuinely trying to avoid
blocking at all costs on a really hot event loop, and the semantics seem
to make sense to me. It's not that different from the networking case
where no amount of read() on a non-blocking fd will get you more data
unless there's another process somewhere filling the stream.
--Stephen
-
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/