tools-mm-introduce-a-tool-to-assess-swap-entry-allocation-for-thp_swapout.patch removed from -mm tree
The quilt patch titled
Subject: tools/mm: introduce a tool to assess swap entry allocation for thp_swapout
has been removed from the -mm tree. Its filename was
tools-mm-introduce-a-tool-to-assess-swap-entry-allocation-for-thp_swapout.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: Barry Song <[email protected]>
Subject: tools/mm: introduce a tool to assess swap entry allocation for thp_swapout
Date: Sat, 22 Jun 2024 19:12:31 +1200
Both Ryan and Chris have been utilizing the small test program to aid in debugging and identifying issues with swap entry allocation. While a real or intricate workload might be more suitable for assessing the correctness and effectiveness of the swap allocation policy, a small test program presents a simpler means of understanding the problem and initially verifying the improvements being made.
Let's endeavor to integrate it into tools/mm. Although it presently only accommodates 64KB and 4KB, I'm optimistic that we can expand its capabilities to support multiple sizes and simulate more complex systems in the future as required.
Basically, we have
1. Use MADV_PAGEPUT for rapid swap-out, putting the swap allocation code under high exercise in a short time.
2. Use MADV_DONTNEED to simulate the behavior of libc and Java heap in freeing memory, as well as for munmap, app exits, or OOM killer scenarios. This ensures new mTHP is always generated, released or swapped out, similar to the behavior on a PC or Android phone where many applications are frequently started and terminated.
3. Swap in with or without the "-a" option to observe how fragments due to swap-in and the incoming swap-in of large folios will impact swap-out fallback.
Due to 2, we ensure a certain proportion of mTHP. Similarly, because of 3, we maintain a certain proportion of small folios, as we don't support large folios swap-in, meaning any swap-in will immediately result in small folios. Therefore, with both 2 and 3, we automatically achieve a system containing both mTHP and small folios. Additionally, 1 provides the ability to continuously swap them out.
We can also use "-s" to add a dedicated small folios memory area.
---
tools/mm/Makefile | 2 tools/mm/thp_swap_allocator_test.c | 234 +++++++++++++++++++++++++++ 2 files changed, 235 insertions(+), 1 deletion(-)
tools/mm/Makefile renamed from tools/mm/Makefile~tools-mm-introduce-a-tool-to-assess-swap-entry-allocation-for-thp_swapout +1 -1
@@ -3,7 +3,7 @@ # include ../scripts/Makefile.include -BUILD_TARGETS=page-types slabinfo page_owner_sort +BUILD_TARGETS=page-types slabinfo page_owner_sort thp_swap_allocator_test INSTALL_TARGETS = $(BUILD_TARGETS) thpmaps LIB_DIR = ../lib/api
tools/mm/thp_swap_allocator_test.c new file +234 -0
234 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are