[PATCH] fadvise(2) system call

Alfred Perlstein alfred at freebsd.org
Wed Nov 9 17:16:50 UTC 2011


* John Baldwin <jhb at freebsd.org> [111109 07:00] wrote:
> On Wednesday, November 09, 2011 1:18:07 am Tim Kientzle wrote:
> > It's not at all obvious.
> > 
> > If I have 1GB of cache and I'm going
> > to generate and then read back a 2GB file,
> > the best strategy is to hold the first
> > 1GB in cache.
> > 
> > If I'm going to write the file and it will never be
> > read back, then the best strategy is to not
> > cache any of it.
> > 
> > Sometimes, a program knows which of
> > these is likely, but if it doesn't know, it shouldn't
> > say.
> 
> Exactly.

Exactly what?  All I see you and Tim going back and forth on is
that "we can't catch 100% of the cases, so it's best to do nothing".

Tim's contrived example of:
> > If I have 1GB of cache and I'm going
> > to generate and then read back a 2GB file,
> > the best strategy is to hold the first
> > 1GB in cache.

How exactly would a user tell tar(1) to do this on the command line?
Would your average user be smart enough to do this?  Is it worth
making tar's default "blow out all the memory in the box" because
of some esoteric use case that you and Tim seem to think exist
that has not even been explicitly stated?  (seems like you want
some command line option to tell tar --only-cache-first-nbytes=#???)
Do you realize how ridiculous that sounds?

Are all heuristics bad because there's a 1% or 0.1% chance that
someone will have a use-case that defeats it?

The only sense I can make of your and Tim's argument is a desperate
grasp to shut down an idea based on some kind of "I'll back you if
you back me no matter how dumb this gets" politics rather than
anything that makes sense.

I'm going to leave it at politics because I actually thought the
two of you were smarter than this and that's the only thing that
keeps that assumption working in my head.

-- 
- Alfred Perlstein
.- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10
.- FreeBSD committer


More information about the freebsd-arch mailing list