[patches] [PATCH 2/5] vinyl: get rid of obscure page cache promotion logic
Konstantin Osipov
kostja at tarantool.org
Mon Mar 5 08:06:54 MSK 2018
* Vladimir Davydov <vdavydov.dev at gmail.com> [18/03/04 23:00]:
> vy_run_iterator_load_page() keeps two most recently read pages. This
> makes sense, because we often probe a page for a better match. Keeping
> two pages rather than just one makes sure we won't throw out the current
> page if probing fails to find a better match. What doesn't make sense
> though is cache promotion logic: we keep promoting the page containing
> the current key. The comment says:
>
> /*
> * The cache is at least two pages. Ensure that
> * subsequent read keeps the cur_key in the cache
> * by moving its page to the start of LRU list.
> */
> vy_run_iterator_cache_touch(itr, cur_key_page_no);
>
> The comment is quite misleading. The "cache" contains at most two pages.
> Proudly calling this travesty of a cache LRU is downright ridiculous.
Vladimir, travesty is a bit stronger word than what I would like
to see in our revision history. I understand and respect
traditions of the Linux kernel, but we're not. Sorry for
nitpicking ;)
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.org - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list