@@ -81,6 +81,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
THP_SPLIT_PAGE_FAILED,
THP_DEFERRED_SPLIT_PAGE,
THP_SPLIT_PMD,
+ THP_PROMOTE_PMD,
+ THP_PROMOTE_PAGE,
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
THP_FAULT_ALLOC_PUD,
THP_FAULT_FALLBACK_PUD,
@@ -89,6 +91,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
THP_SPLIT_PUD_PAGE_FAILED,
THP_ZERO_PUD_PAGE_ALLOC,
THP_ZERO_PUD_PAGE_ALLOC_FAILED,
+ THP_PROMOTE_PUD,
+ THP_PROMOTE_PUD_PAGE,
#endif
THP_ZERO_PAGE_ALLOC,
THP_ZERO_PAGE_ALLOC_FAILED,
@@ -4403,6 +4403,8 @@ int promote_huge_pmd_address(struct vm_area_struct *vma, unsigned long haddr)
out_unlock:
anon_vma_unlock_write(vma->anon_vma);
out:
+ if (!ret)
+ count_vm_event(THP_PROMOTE_PMD);
return ret;
}
@@ -4644,6 +4646,8 @@ int promote_list_to_huge_page(struct page *head, struct list_head *list)
put_anon_vma(anon_vma);
}
out:
+ if (!ret)
+ count_vm_event(THP_PROMOTE_PAGE);
return ret;
}
@@ -4842,6 +4846,8 @@ int promote_huge_pud_address(struct vm_area_struct *vma, unsigned long haddr)
out_unlock:
anon_vma_unlock_write(vma->anon_vma);
out:
+ if (!ret)
+ count_vm_event(THP_PROMOTE_PUD);
return ret;
}
@@ -5169,6 +5175,8 @@ int promote_list_to_huge_pud_page(struct page *head, struct list_head *list)
unlock_page(p);
putback_lru_page(p);
}
+ if (!ret)
+ count_vm_event(THP_PROMOTE_PUD_PAGE);
return ret;
}
@@ -1259,6 +1259,8 @@ const char * const vmstat_text[] = {
"thp_split_page_failed",
"thp_deferred_split_page",
"thp_split_pmd",
+ "thp_promote_pmd",
+ "thp_promote_page",
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
"thp_fault_alloc_pud",
"thp_fault_fallback_pud",
@@ -1267,6 +1269,8 @@ const char * const vmstat_text[] = {
"thp_split_pud_page_failed",
"thp_zero_pud_page_alloc",
"thp_zero_pud_page_alloc_failed",
+ "thp_promote_pud",
+ "thp_promote_pud_page",
#endif
"thp_zero_page_alloc",
"thp_zero_page_alloc_failed",