Re: [PATCH][RESEND] don't allow sys_readahead() on files opened withO_DIRECT

From: Jan Blunck
Date: Thu Aug 25 2005 - 07:20:08 EST


Andrew Morton schrieb:
>
> a) It doesn't hurt, it's just a bit of a silly thing to do.

IMO it may hurt the performance.

>
> b) posix_fadvise(POSIX_FADV_WILLNEED) should get the same treatment (and
> it's the preferred way of doing readahead).

Yes, of course.

>
> c) O_DIRECT fd's should, as much as possible, offer the same ABI as
> buffered fd's.

Hmm, with XIP fd's we agreed on the following behavior: fadvise() and
madvise() just return without reading anything to the page cache. Since
XIP fd's are similar to O_DIRECT fd's their behavior should be similar,
too. If we don't honor the advises we might also ignore the syscall. At
least redhat's readahead is using them.

Maybe we should agree on one behavior that makes sense. And I don't see
any point in filling the page cache when it is not needed.

>
> d) The patch could break existing apps.

Since it could break applications that are already (some kind of) broken
that shouldn't be a problem.

So you think it is better to read nothing to the page cache and return
zero instead? This seems like "lying" to the user-space :)
-
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/