[PATCH] fadvise(2) system call

Peter Wemm peter at wemm.org
Thu Nov 10 01:03:53 UTC 2011


On Tue, Nov 8, 2011 at 5:00 AM, John Baldwin <jhb at freebsd.org> wrote:
> On Friday, November 04, 2011 12:03:20 pm Alfred Perlstein wrote:
>> * John Baldwin <jhb at FreeBSD.org> [111103 19:38] wrote:
>> > On 11/2/11 1:20 PM, Alfred Perlstein wrote:
>> > >* John Baldwin<jhb at freebsd.org>  [111102 11:05] wrote:
>> > >>On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote:
>> > >>>On 01/11/2011 17:08, John Baldwin wrote:
>> > >>>>I had found it via the web: http://linux.die.net/man/2/fadvise
>> > >>>>However, after further searching it appears to be stale (if you follow
>> > >>>>it's cross-reference to madvise(2), that page only has links to
>> > >>>>posix_fadvise() and not fadvise()).
>> > >>>
>> > >>>There's
>> > >>>http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross-
>> > >>reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800
>> > >>>for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX
>> > >>>1003.1-2001 Standard"), though it also has posix_fadvise.
>> > >>
>> > >>Hmm, that one actually has an extra argument.  I'll just go with
>> > >>posix_fadvise() for now.  Interesting that HP lets you OR together
>> > >>two policies (so you can say both "I will access this file sequentially
>> > >>and with noreuse").
>> > >
>> > >Makes sense for gzip/tar.
>> >
>> > Ehh, quite possibly not for something that generic.  I think you only
>> > want to do this if you have very specific knowledge about your access
>> > pattern, and I do not think they are generically applicable.
>>
>> You often spend time untarring the same tarball over and over
>> in your workflow John?
>
> No, but many people will do a 'tar tvf' of a file after they generate it.
> Would be rather silly to force that to go to disk every time, especially given
> tar's format where it does not have a header like zip so you have to read the
> whole darn thing for a 'tar tvf'.

Did 'tar tvf' stop seeking and doing random seek/reads for raw tar
files?  I know it can't do this for a stream compressed file and
there's no choice but to read it all.

-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell


More information about the freebsd-arch mailing list