From owner-freebsd-hackers Thu Oct 30 03:21:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA02774 for hackers-outgoing; Thu, 30 Oct 1997 03:21:04 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from ocean.campus.luth.se (ocean.campus.luth.se [130.240.194.116]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA02769 for ; Thu, 30 Oct 1997 03:20:57 -0800 (PST) (envelope-from karpen@ocean.campus.luth.se) Received: (from karpen@localhost) by ocean.campus.luth.se (8.8.5/8.8.5) id MAA10740; Thu, 30 Oct 1997 12:29:30 +0100 (CET) From: Mikael Karpberg Message-Id: <199710301129.MAA10740@ocean.campus.luth.se> Subject: Re: help with fstat? In-Reply-To: <199710300520.WAA00554@usr05.primenet.com> from Terry Lambert at "Oct 30, 97 05:20:47 am" To: tlambert@primenet.com (Terry Lambert) Date: Thu, 30 Oct 1997 12:29:30 +0100 (CET) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31H (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk According to Terry Lambert: > My problem is with it being cached, since it's now on the LRU list > ahead of my page that's been cached, and the user promised us that > he's never going to reference the thing again. So why is it cached > instead of "cached with extreme prejudice"... ie: inserted at the LRU > head as if it were truly the least recently used instead of in LRU > order, where it can force my pages (which I *am* going to reference > again) out of core? Well, it's not for sure that the pages used in a MADV_SEQUENTIAL reading in a process will not be used again, is it? I might back up a few bytes in parsing text, for example, but ALMOST be sequential, and then it might be a good idea to hint the system anyway. That would easilly be solved with three pages, though, if one page is enough read ahead. But the real case of where it will be reused is, actually, if many processes access the file after eachother, or almost simultaniously. That might be the case for something like a loaded webserver where the speed of a read might matter a lot. It might be mmaping and writing a whole bunch of index.html copies a second, accessing them sequientally, in which it is likely to use MADV_SEQUENTIAL, no? It's a very good thing if it doesn't trash those pages right away, then. But less accessed pages will be very happily discareded right away. They will not be moved back in the free-queue all the time, because they are not accessed again. So they WILL be truly discarded. Now, this might not be completely correct, but don't I have a point, Terry? /Mikael