Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The eviction consumes old generations. Given an lruvec, the eviction scans pages on lrugen->lists indexed by anon and file min_seq[2] (modulo MAX_NR_GENS). It first tries to select a type based on the values of min_seq[2]. If they are equal, it selects the type that has a lower refault rate. The eviction sorts a page according to its updated generation number if the aging has found this page accessed. It also moves a page to the next generation if this page is from an upper tier that has a higher refault rate than the base tier. The eviction increments min_seq[2] of a selected type when it finds lrugen->lists indexed by min_seq[2] of this selected type are empty. With the aging and the eviction in place, implementing page reclaim becomes quite straightforward: 1) To reduce the latency, direct reclaim skips the aging unless both min_seq[2] are equal to max_seq-1. Then it invokes the eviction. 2) To avoid the aging in the direct reclaim path, kswapd invokes the aging if either of min_seq[2] is equal to max_seq-1. Then it invokes the eviction. Signed-off-by: Yu Zhao <yuzhao@google.com> Tested-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
- Loading branch information