diff mbox series

[11/18] mm: memory: use mm_counter_file_folio() in wp_page_copy()

Message ID 20231103140119.2306578-12-wangkefeng.wang@huawei.com (mailing list archive)
State New
Headers show
Series mm: convert to use folio mm counter | expand

Commit Message

Kefeng Wang Nov. 3, 2023, 2:01 p.m. UTC
Use mm_counter_file_folio() to save one compound_head() call.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mm/memory.c b/mm/memory.c
index d35ca499bf1c..661c649afc22 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3158,7 +3158,7 @@  static vm_fault_t wp_page_copy(struct vm_fault *vmf)
 	if (likely(vmf->pte && pte_same(ptep_get(vmf->pte), vmf->orig_pte))) {
 		if (old_folio) {
 			if (!folio_test_anon(old_folio)) {
-				dec_mm_counter(mm, mm_counter_file(&old_folio->page));
+				dec_mm_counter(mm, mm_counter_file_folio(old_folio));
 				inc_mm_counter(mm, MM_ANONPAGES);
 			}
 		} else {