Date: Tue, 8 Nov 2011 22:18:07 -0800 From: Tim Kientzle <tim@kientzle.com> To: Alfred Perlstein <alfred@freebsd.org> 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: <3D0BF37D-0C31-4509-A231-F4D1F81472D8@kientzle.com> In-Reply-To: <20111109043512.GT6110@elvis.mu.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D0BF37D-0C31-4509-A231-F4D1F81472D8>