Re: VM disk cache behavior.

From: Kevin Puetz
Date: Wed Feb 09 2005 - 00:05:29 EST


Andy Isaacson wrote:

> Most likely is that your app isn't behaving in a cache-friendly way.ÂÂIf
> your file will fit in memory, just fault it in sequentially (wc -l file)
> and then your app should cook.ÂÂIfÂyou'reÂnotÂgoingÂtoÂfitÂinÂmemory,
> the vm caching will probably only help if you have some reuse; you could
> develop a pre-faulter to get your IO started ahead of time, but that's
> generally nontrivial.

Of course, what's non-trivial is predicting your upcoming I/O pattern
(unless it's not actually random at all, just messy). Calling madvise to
prefault it is pretty easy if you actually do know what you'll want in the
near future.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/