BACKPORT: mm: count the number of partially mapped anonymous THPs per size
When a THP is added to the deferred_list due to partially mapped, its partial pages are unused, leading to wasted memory and potentially increasing memory reclamation pressure. Detailing the specifics of how unmapping occurs is quite difficult and not that useful, so we adopt a simple approach: each time a THP enters the deferred_list, we increment the count by 1; whenever it leaves for any reason, we decrement the count by 1. Link: https://lkml.kernel.org/r/20240824010441.21308-3-21cnbao@gmail.com Change-Id: Ie4473bc34ddfa7ce748bcd380927697610faa5a8 Signed-off-by:Barry Song <v-songbaohua@oppo.com> Acked-by:
David Hildenbrand <david@redhat.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Chris Li <chrisl@kernel.org> Cc: Chuanhua Han <hanchuanhua@oppo.com> Cc: Kairui Song <kasong@tencent.com> Cc: Kalesh Singh <kaleshsingh@google.com> Cc: Lance Yang <ioworker0@gmail.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Shuai Yuan <yuanshuai@oppo.com> Cc: Usama Arif <usamaarif642@gmail.com> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit 8175ebfd) [ Fix trivial conflicts in huge_memory.c, huge_mm.h, transhuge.rst - Kalesh Singh ] Bug: 419599659 Bug: 421481159 Signed-off-by:
Kalesh Singh <kaleshsingh@google.com>
Loading
Please sign in to comment