On Thu, Sep 03, 2026 at 03:46:20PM +0100, Yeoreum Yun wrote: > > > On Wed, Sep 02, 2026 at 06:56:11PM +0100, Yeoreum Yun wrote: > > > > HPAGE_SIZE and HPAGE_SHIFT macro is written based on the 4KB PAGE_SIZE. > > > > When this macro is used in some test, test result would be strange in > > > > the system where PAGE_SIZE is more than 4KB. > > > > > > > > Here is example with transhuge-stress test with 16KB PAGE_SIZE: > > > > > > > > transhuge-stress: allocate 61073 transhuge pages, using 122146 MiB > > > > virtual memory and 1908 MiB of ram > > > > 3.292 s/loop, 0.054 ms/page, 37106.002 MiB/s 2566 succeed, > > > > 58507 failed, 2566 different pages > > > > 0.591 s/loop, 0.010 ms/page, 206850.792 MiB/s 0 succeed, > > > > 61073 failed, 0 different pages > > > > 0.527 s/loop, 0.009 ms/page, 231895.107 MiB/s 0 succeed, > > > > 61073 failed, 0 different pages > > > > 0.527 s/loop, 0.009 ms/page, 231839.704 MiB/s 0 succeed, > > > > 61073 failed, 0 different pages > > > > 0.528 s/loop, 0.009 ms/page, 231544.782 MiB/s 0 succeed, > > > > 61073 failed, 0 different pages > > > > 0.528 s/loop, 0.009 ms/page, 231462.074 MiB/s 0 succeed, > > > > 61073 failed, 0 different pages > > > > 0.527 s/loop, 0.009 ms/page, 231770.300 MiB/s 0 succeed, > > > > 61073 failed, 0 different pages > > > > ... > > > > ok 1 Completed > > > > > > > > Remove the HPAGE_SIZE and HPAGE_SHIFT macro. and introduce hpshift() > > > > helper to get the HPAGE_SHIFT properly. For HPAGE_SIZE, use pre-exist > > > > helper, read_pmd_pagesize(). > > > > > > > > Also, do KSM_MERGE_TIME_HUGE_PAGES test with size of 512 MiB which > > > > is the LCD pmd_size among 4KB, 16KB and 64KB page_size. > > > > > > Probably worth spelling out Least Common Denominator for those who might > > > mistaken this for a kind of display panel :P > > > > Bad typo :( LCM (least common multiple) :( > > > > > > > > I also wonder if it's worth pulling that out as a separate patch in a > > > series for > > > better bisectability? > > > > Okay. I'll separate it. > > Hmm, I think it would be better to keep the change as is, including the > updated ksm_tests parameter. Although allocate_transhuge() correctly > allocates mappings aligned to the PMD page size, `ksm_tests -H -s 100` > would otherwise fail because 100 MiB is not a multiple of the PMD page > size.
OK, just add a note about it in the commit msg :) > > [...] > > -- > Sincerely, > Yeoreum Yun -- Cheers, Lorenzo
