Pádraig Brady <[EMAIL PROTECTED]> writes:

> http://www.die.net/doc/linux/man/man2/posix_fadvise.2.html

Wow.  That makes it seem like POSIX_FADV_SEQUENTIAL isn't nearly as
useful as it should be.

What I think you're saying is that applications must invoke
POSIX_FADV_DONTNEED by hand after reading or writing every sequential
page.  But this is what POSIX_FADV_SEQUENTIAL is designed for, no?
That is, POSIX_FADV_SEQUENTIAL should be tuned for usage patterns like
dd's, right?  Why isn't it?

(Now I'm starting to understand why almost nobody uses posix_fadvise.  :-)


>> +  posix_fadvise (STDIN_FILENO, 0, 0, POSIX_FADV_SEQUENTIAL);
>> +  posix_fadvise (STDOUT_FILENO, 0, 0, POSIX_FADV_SEQUENTIAL);
>
> That's mad. That trival patch works fine here on
> coreutils-6.2 + glibc-2.3.5-10 + 2.6.16-1.2111_FC4 at least.

It sounds like we'll have to have a fairly-careful runtime test then,
with the default being not to use posix_fadvise unless we're sure it
won't dump core.  Debian stable is not a platform I'd like to abandon
quite just yet....


One option I toyed with is giving users direct access to the
posix_fadvise parameters, so they can set the options themselves,
and get core dumps on their own.  E.g., 

dd iadvice=sequential oadvice=sequential

This is sort of like iflags and oflags, but for posix_fadvice.  It
matches the POSIX spec fairly well, though it is a bit overkill (would
'dd' really have any use for iadvice=random? :-).  But the problem is
that it doesn't match Linux's somewhat odd interpretation of
posix_fadvise very well.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to