On 29 Sep 2026, at 9:15, Kiryl Shutsemau wrote: > From: "Kiryl Shutsemau (Meta)" <[email protected]> > > check_huge_anon() and check_huge_file() open /proc/self/pagemap and > /proc/kpageflags on every call and read the PMD size from sysfs on top. > The khugepaged test calls them hundreds of times. > > Open both once and keep the descriptors. A pagemap descriptor is tied > to the mm of the process that opened it, and the khugepaged fork() cases > call check_huge() from the child, so reopen it when getpid() changes. > > Cache the PMD size in read_pmd_pagesize() as well.
This part might be overlapping with Yeoreum’s another series[1]. [1] https://lore.kernel.org/all/[email protected]/ > > Assisted-by: LLM > Signed-off-by: Kiryl Shutsemau (Meta) <[email protected]> > --- > tools/testing/selftests/mm/vm_util.c | 68 ++++++++++++++++++++-------- > 1 file changed, 50 insertions(+), 18 deletions(-) > Best Regards, Yan, Zi

