HPA: Correctly calculate retained pages

Retained pages are those which haven't been touched and are unbacked from OS
perspective. For a pageslab their number should equal "total pages in slab"
minus "touched pages".
This commit is contained in:
Alex Lapenkou 2021-08-19 15:16:11 -07:00 committed by Alexander Lapenkov
parent 2c625d5cd9
commit c01a885e94

View File

@ -292,7 +292,7 @@ hpdata_ndirty_get(hpdata_t *hpdata) {
static inline size_t
hpdata_nretained_get(hpdata_t *hpdata) {
return hpdata->h_nactive - hpdata->h_ntouched;
return HUGEPAGE_PAGES - hpdata->h_ntouched;
}
static inline void