bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dd interface to posix_fadvise


From: Paul Eggert
Subject: Re: dd interface to posix_fadvise
Date: Thu, 08 Mar 2007 17:12:18 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Pádraig Brady <address@hidden> writes:

>> 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?
>
> There used to be an O_STREAM flag that did all this.
> Pity they removed it in preference for the posix interface.

I don't mind the interface change, but I do mind
POSIX_FADV_SEQUENTIAL exhibiting bad performance for straight
sequential access.  That seems to be a clear performance bug.

It's hard to believe that the intent is that one should call
POSIX_FADV_NOREUSE by hand instead, after each read.  That's
enormously inconvenient.

> I'll test on debian stable also to see what the issue is.  Note
> I noticed another issue with glibc where it always returns 0,
> even if you do posix_fadvise() on a pipe or invalid file
> descriptor...  The errno is set appropriately, but I don't think
> you can generally query that if the call returns success?

According to the POSIX spec, posix_fadvise is a little unusual: it
returns 0 on success, and an error number on failure.  errno is
junk after calling it, I guess.

Could be that Linux got this wrong, too.

> I don't like that personally. I don't think that granularity
> will be required in a tool like dd. I'm going with the
> more abstract [io]flag=nocache interface for the moment,

If it's purely a performance improvement, I'd be inclined to
enable it all the time.  That's even simpler, from the user's
point of view.  (I don't envy the job of writing the Autoconf
macro for this one, though, as it seems to be a reallly buggy
feature.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]