hpdata: Rename "dirty" to "touched".

This matches the usage in the rest of the codebase.
This commit is contained in:
David Goldblatt
2020-12-03 18:58:58 -08:00
committed by David Goldblatt
parent be0d7a53f3
commit 68a1666e91
4 changed files with 34 additions and 29 deletions

View File

@@ -67,14 +67,14 @@ struct hpdata_s {
fb_group_t active_pages[FB_NGROUPS(HUGEPAGE_PAGES)];
/*
* Number of dirty pages, and a bitmap tracking them. This really means
* "dirty" from the OS's point of view; it includes both active and
* inactive pages that have been touched by the user.
* Number of dirty or active pages, and a bitmap tracking them. One
* way to think of this is as which pages are dirty from the OS's
* perspective.
*/
size_t h_ndirty;
size_t h_ntouched;
/* The dirty pages (using the same definition as above). */
fb_group_t dirty_pages[FB_NGROUPS(HUGEPAGE_PAGES)];
fb_group_t touched_pages[FB_NGROUPS(HUGEPAGE_PAGES)];
};
TYPED_LIST(hpdata_list, hpdata_t, ql_link)
@@ -148,9 +148,14 @@ hpdata_nactive_get(hpdata_t *hpdata) {
return hpdata->h_nactive;
}
static inline size_t
hpdata_ntouched_get(hpdata_t *hpdata) {
return hpdata->h_ntouched;
}
static inline size_t
hpdata_ndirty_get(hpdata_t *hpdata) {
return hpdata->h_ndirty;
return hpdata->h_ntouched - hpdata->h_nactive;
}
static inline void
@@ -174,14 +179,14 @@ hpdata_consistent(hpdata_t *hpdata) {
!= hpdata->h_nactive) {
return false;
}
if (fb_scount(hpdata->dirty_pages, HUGEPAGE_PAGES, 0, HUGEPAGE_PAGES)
!= hpdata->h_ndirty) {
if (fb_scount(hpdata->touched_pages, HUGEPAGE_PAGES, 0, HUGEPAGE_PAGES)
!= hpdata->h_ntouched) {
return false;
}
if (hpdata->h_ndirty < hpdata->h_nactive) {
if (hpdata->h_ntouched < hpdata->h_nactive) {
return false;
}
if (hpdata->h_huge && hpdata->h_ndirty != HUGEPAGE_PAGES) {
if (hpdata->h_huge && hpdata->h_ntouched != HUGEPAGE_PAGES) {
return false;
}
return true;