Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 1997 12:29:30 +0100 (CET)
From:      Mikael Karpberg <karpen@ocean.campus.luth.se>
To:        tlambert@primenet.com (Terry Lambert)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: help with fstat?
Message-ID:  <199710301129.MAA10740@ocean.campus.luth.se>
In-Reply-To: <199710300520.WAA00554@usr05.primenet.com> from Terry Lambert at "Oct 30, 97 05:20:47 am"

next in thread | previous in thread | raw e-mail | index | archive | help
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



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