Date: Thu, 30 Jan 2003 19:47:31 -0800 From: David Schultz <dschultz@uclink.Berkeley.EDU> To: Fergal Daly <fergal@esatclear.ie> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Random disk cache expiry Message-ID: <20030131034731.GB11445@HAL9000.homeunix.com> In-Reply-To: <200301310127.38826.fergal@esatclear.ie> References: <200301310127.38826.fergal@esatclear.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Fergal Daly <fergal@esatclear.ie>: > kientzle@acm.org (Tim Kientzle) wrote in message > news:<b128ta$b0n$1@FreeBSD.csie.NCTU.edu.tw>... > > Personally, I think there's a lot of merit to _trying_ > > There's even more merit in only pretending to try... Welcome to my quotes file. > As you can see, the locking cache is always better than the random one and the > file doesn't have to be very big for it to be hugely better. You have found an optimal replacement algorithm for the case of repeated sequential reads. In fact, if you know in advance what the access pattern is going to be, it is *always* possible to find an optimal replacement algorithm. Specifically, you always replace the block in the cache that will not be used for the longest time in the future. If you want the system to always cache the right thing in the general case, the only hint you would need to provide the system is a reference string specifying the predicted access pattern. (If I were to do this, my first reaction would be to encode it as an FSA.) If that proves to be infeasible, I'm sure there are ways to approximate the same thing. The hard parts, I think, would be teaching the VM system to use the new information, and gathering statistics from which you form your hints. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030131034731.GB11445>