Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2011 03:08:49 -0800
From:      Alfred Perlstein <alfred@freebsd.org>
To:        Tim Kientzle <tim@kientzle.com>
Cc:        Bruce Cran <bruce@cran.org.uk>, Ed Schouten <ed@80386.nl>, freebsd-arch@freebsd.org, Jilles Tjoelker <jilles@stack.nl>, arch@freebsd.org
Subject:   Re: [PATCH] fadvise(2) system call
Message-ID:  <20111109110849.GV6110@elvis.mu.org>
In-Reply-To: <3D0BF37D-0C31-4509-A231-F4D1F81472D8@kientzle.com>
References:  <201110281426.00013.jhb@freebsd.org> <4EB2C9DD.9090606@FreeBSD.org> <20111104160319.GD6110@elvis.mu.org> <201111080800.32717.jhb@freebsd.org> <20111109033504.GS6110@elvis.mu.org> <840E509B-0D63-41C2-B26A-31655F1D42C2@kientzle.com> <20111109043512.GT6110@elvis.mu.org> <3D0BF37D-0C31-4509-A231-F4D1F81472D8@kientzle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
http://bit.ly/hwm4GC

* Tim Kientzle <tim@kientzle.com> [111108 22:18] wrote:
> On Nov 8, 2011, at 8:35 PM, Alfred Perlstein wrote:
> 
> > A query to sysctl, perhaps 'vfs.bufspace' (I haven't bothered to
> > look at the actual correct sysctl node to query) would give a real
> > indication of the amount of buffer size there is.
> 
> The kernel knows the size of the file and knows how
> much buffer cache there is.  So the kernel already knows
> whether the file will fit.
> 
> >  If the file to
> > extract is larger than that size, it would be pretty obvious to use
> > the "will not need" flag for file access.
> 
> 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.
> 
> Tim

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111109110849.GV6110>