> By doing so you will end up talking to your block device _every_ time you > try to look up an item in the cache. You might want to consider keeping the > data structures in memory instead...
well, mmap'ed pages are buffered by linux using the page cache, it is possible the cache lookup will share a page that's already resident in memory and hasn't been pdflushed. worst case, if the page is not in the page cache, we will have some latency as those blocks are fetched from the device and the missing page is populated. my device has tens of microseconds latency for accesses (page cache misses) but that should still be an order of magnitude or 2 faster than the application having to go to disk, right? thanks! Mitch.
