At 17 Aug 2004 01:48:05 -0700, Thomas Bushnell BSG wrote: > > "Neal H. Walfield" <[EMAIL PROTECTED]> writes: > > > If you didn't have this eviction strategy in mind for draining the > > mapping cache, I am curious what you were going to do. It seems to me > > that anything else would be in far greater contention with the > > kernel's eviction strategy. This is my analysis from the I sent on > > the 16th entitled "Review of Thomas's >2GB ext2fs proposal:" > > Nothing is necessary. You simply de-map, with vm_unmap. Doing so > does not cause the page to be paged out by the kernel, and has > nothing whatsoever to do with the kernel's pageout strategy. Unlike > paging, vm_map and vm_unmap are purely local operations where no > global optimization is relevant, so there is no reason to prefer > kernel control over them.
De-mapping is not an eviction strategy. How do you choose which mappings to get rid of once the cache is filled? If the operations are really of trivial cost, then we needn't cache the mappings; we just vm_map and vm_unmap the pages each time they are requested and thereby eliminate any reference counting system. > So I would simply advocate a straightforward LRU of such things, with > a reference count for the number of users of a mapping. What is the time stamp you will use? I don't need to save any extra data in my proposal. This is extra memory you are using. > The reference count, incidentally, you still need for your version, > don't you? Sure. But a reference is held for a relatively short time (most mappings will have a reference count of zero). Hence, if a page has no references it does not mean it will not be used in the near future. Consider how a sequential read works: client asks for a page, meta data is consulted (hence a reference is gotten), block list is obtained (reference is dropped), data is gotten and returned to user which process the data; repeat. For most of the time, the reference on the page is zero. > If you drop mappings whenever the kernel evicts a page, what do you do > for pageouts of currently active pages? How do you distinguish this > from a pageout of an idle page? Why is the kernel dropping the page if it is active in the first place? This logic seems suspect. The interesting corner case is what happens if there are user references and the kernel drops the page. Well, in this case, we just leave the mapping in place based on the assumption that the page will be faulted back in momentarily (otherwise, why would there by a reference?). Neal _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-hurd