From owner-freebsd-arch@FreeBSD.ORG Wed Nov 9 11:08:50 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9679C106564A; Wed, 9 Nov 2011 11:08:50 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 81BEF8FC0A; Wed, 9 Nov 2011 11:08:50 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 241031A3C55; Wed, 9 Nov 2011 03:08:50 -0800 (PST) Date: Wed, 9 Nov 2011 03:08:49 -0800 From: Alfred Perlstein To: Tim Kientzle Message-ID: <20111109110849.GV6110@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> <3D0BF37D-0C31-4509-A231-F4D1F81472D8@kientzle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D0BF37D-0C31-4509-A231-F4D1F81472D8@kientzle.com> User-Agent: Mutt/1.4.2.3i Cc: Bruce Cran , Ed Schouten , freebsd-arch@freebsd.org, Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 11:08:50 -0000 http://bit.ly/hwm4GC * Tim Kientzle [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