Fix # of unpurged pages in decay algorithm.

When # of dirty pages move below npages_limit (e.g. they are reused), we should
not lower number of unpurged pages because that would cause the reused pages to
be double counted in the backlog (as a result, decay happen slower than it
should).  Instead, set number of unpurged to the greater of current npages and
npages_limit.

Added an assertion: the ceiling # of pages should be greater than npages_limit.
This commit is contained in:
Qi Wang
2017-05-22 13:09:17 -07:00
committed by Qi Wang
parent 0eae838b0d
commit eeefdf3ce8
2 changed files with 29 additions and 11 deletions

View File

@@ -103,6 +103,8 @@ struct arena_decay_s {
*
* Synchronization: Same as associated arena's stats field. */
decay_stats_t *stats;
/* Peak number of pages in associated extents. Used for debug only. */
uint64_t ceil_npages;
};
struct arena_bin_s {