On Wed, Apr 15, 2020 at 02:25:30PM -0700, Yang Shi wrote:
It might be reasonable as part of wider cleanup: the same has to be done@@ -595,6 +626,12 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,It may be better to extract the check into a helper? For example, bool
VM_BUG_ON_PAGE(!PageAnon(page), page);
+ if (page_mapcount(page) > 1 &&
+ ++shared > khugepaged_max_ptes_shared) {
+ result = SCAN_EXCEED_SHARED_PTE;
exceed_max_ptes_shared(struct page)?
to khugepaged_max_ptes_none and khugepaged_max_ptes_swap.
Volunteers? :P