Skip to contentSkip to conversation

mm-khugepaged-cleanup-memcg-uncharge-for-failure-path.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 28, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/khugepaged: cleanup memcg uncharge for failure path
has been removed from the -mm tree. Its filename was
mm-khugepaged-cleanup-memcg-uncharge-for-failure-path.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Peter Xu <[email protected]>
Subject: mm/khugepaged: cleanup memcg uncharge for failure path
Date: Fri, 3 Mar 2023 10:12:18 -0500

Explicit memcg uncharging is not needed when the memcg accounting has the same lifespan of the page/folio. That becomes the case for khugepaged after Yang & Zach's recent rework so the hpage will be allocated for each collapse rather than being cached.

Cleanup the explicit memcg uncharge in khugepaged failure path and leave that for put_page().

---

 mm/khugepaged.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
mm/khugepaged.c renamed from mm/khugepaged.c~mm-khugepaged-cleanup-memcg-uncharge-for-failure-path +2 -6
@@ -1136,10 +1136,8 @@ static int collapse_huge_page(struct mm_
 out_up_write:
 	mmap_write_unlock(mm);
 out_nolock:
-	if (hpage) {
-		mem_cgroup_uncharge(page_folio(hpage));
+	if (hpage)
 		put_page(hpage);
-	}
 	trace_mm_collapse_huge_page(mm, result == SCAN_SUCCEED, result);
 	return result;
 }
@@ -2145,10 +2143,8 @@ xa_unlocked:
 		unlock_page(hpage);
 out:
 	VM_BUG_ON(!list_empty(&pagelist));
-	if (hpage) {
-		mem_cgroup_uncharge(page_folio(hpage));
+	if (hpage)
 		put_page(hpage);
-	}
 
 	trace_mm_khugepaged_collapse_file(mm, hpage, index, is_shmem, addr, file, nr, result);
 	return result;

_

Patches currently in -mm which might be from [email protected] are

mm-hugetlb-fix-uffd-wr-protection-for-cow-optimization-path.patch mm-hugetlb-fix-uffd-wr-protection-for-cow-optimization-path-v2.patch mm-hugetlb-fix-uffd-wr-protection-for-cow-optimization-path-v3.patch mm-uffd-uffd_feature_wp_unpopulated.patch mm-uffd-uffd_feature_wp_unpopulated-fix.patch selftests-mm-smoke-test-uffd_feature_wp_unpopulated.patch