Messages in this thread | | | Date | Sun, 3 Nov 2013 23:03:28 -0800 | From | Christoph Hellwig <> | Subject | Re: [PATCH] mm: cache largest vma |
| |
On Sun, Nov 03, 2013 at 10:51:27AM -0800, Linus Torvalds wrote: > Ugh. This patch makes me angry. It looks way too ad-hoc. > > I can well imagine that our current one-entry cache is crap and could > be improved, but this looks too random. Different code for the > CONFIG_MMU case? Same name, but for non-MMU it's a single entry, for > MMU it's an array? And the whole "largest" just looks odd. Plus why do > you set LAST_USED if you also set LARGEST? > > Did you try just a two- or four-entry pseudo-LRU instead, with a > per-thread index for "last hit"? Or even possibly a small fixed-size > hash table (say "idx = (add >> 10) & 3" or something)?
Btw, Dave Chiner has recently implemented a simple look aside cache for the buffer cache, which also uses a rbtree. Might beworth into making that into a generic library and use it here:
http://thread.gmane.org/gmane.comp.file-systems.xfs.general/56220
| |