Re: O_DIRECT read and holes in 2.5.26

Andrew Morton
2002-07-22T02:15:28Z

Stephen Lord wrote:
>
> Andrew,
>
> Did you realize that the new O_DIRECT code in 2.5 cannot read over holes
> in a file.

Well that was intentional, although I confess to not having
put a lot of thought into the decision. The user wants
O_DIRECT and we cannot do that. The CPU has to clear the
memory by hand. Bad.

Obviously it's easy enough to put in the code to clear the
memory out. Do you think that should be done?

> The old code filled the user buffer with zeros, the new code
> returned EINVAL if the getblock function returns an unmapped buffer.
> With this exception, XFS does work with the new code - with more cpu
> overhead than before due to the once per page getblock calls.

OK, thanks. Presumably XFS has a fairly heavyweight get_block()?

I'd be interested in seeing just how expensive that O_DIRECT
I/O is, and whether we need to get down and implement a
many-block get_block() interface. Any numbers/profiles
available?

-