Commit 9fad184e authored by Liu Shixin's avatar Liu Shixin
Browse files

mm: huge_memory: add memory reliable count in __discard_anon_folio_pmd_locked()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAO6NS



--------------------------------

In commit a4130bbe, we add a new path unmap_huge_pmd_locked(),
so need to add memory reliable count in this path, i.e., add count
in __discard_anon_folio_pmd_locked().

Fixes: a4130bbe ("mm/vmscan: avoid split lazyfree THP during shrink_folio_list()")
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 3b6fa550
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2933,6 +2933,7 @@ static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
	folio_remove_rmap_pmd(folio, pmd_page(orig_pmd), vma);
	zap_deposited_table(mm, pmdp);
	add_mm_counter(mm, MM_ANONPAGES, -HPAGE_PMD_NR);
	add_reliable_folio_counter(folio, mm, -HPAGE_PMD_NR);
	if (vma->vm_flags & VM_LOCKED)
		mlock_drain_local();
	folio_put(folio);