Improve rtree cache with a two-level cache design.

Two levels of rcache is implemented: a direct mapped cache as L1, combined with
a LRU cache as L2.  The L1 cache offers low cost on cache hit, but could suffer
collision under circumstances.  This is complemented by the L2 LRU cache, which
is slower on cache access (overhead from linear search + reordering), but solves
collison of L1 rather well.
This commit is contained in:
Qi Wang
2017-04-14 11:05:38 -07:00
committed by Qi Wang
parent d16f1e53df
commit 3c9c41edb2
5 changed files with 97 additions and 35 deletions

View File

@@ -55,7 +55,10 @@ struct rtree_ctx_cache_elm_s {
};
struct rtree_ctx_s {
/* Direct mapped cache. */
rtree_ctx_cache_elm_t cache[RTREE_CTX_NCACHE];
/* L2 LRU cache. */
rtree_ctx_cache_elm_t l2_cache[RTREE_CTX_NCACHE_L2];
};
struct rtree_s {