On 6 Apr 2020, at 11:20, Kirill A. Shutemov wrote: > External email: Use caution opening links or attachments > > > On Mon, Apr 06, 2020 at 10:59:52AM -0400, Zi Yan wrote: >> I ran this test with all patches from this series applied to Linus’s >> tree, but still see several failures. Is it expected? > > [Thanks for catching all my typos] > > No. It works fine for me. > Well, occasionally, it fails to swap out a page, but nothing like you have > here. > > Could you try to trace it? I used script like below after mounting > tracefs. You may want to comment out all tests but a failing one. Sure. > > #!/bin/sh -efu > > echo > /sys/kernel/tracing/trace > echo 1 > /sys/kernel/tracing/events/huge_memory/enable > > while ./khugepaged; do > echo > /sys/kernel/tracing/trace > done > > cat /sys/kernel/tracing/trace The test output is (should be useful to tell you the failed tests): root@nvrsysarch-yz:/home/yanzi# ./trace.sh Save THP and khugepaged settings... OK Adjust settings... OK Collapse fully populated PTE table.... Fail Collapse PTE table with single PTE entry present.... Fail Collapse with max_ptes_none PTEs empty.... Fail Swapout one page... OK Collapse with swaping in single PTE entry.... Fail Swapout 64 of 512 pages... OK Collapse with max_ptes_swap pages swapped out.... Fail Allocate huge page... OK Split huge page leaving single PTE mapping compount page... OK Collapse PTE table with single PTE mapping compount page.... Fail Allocate huge page... OK Split huge page leaving single PTE page table full of compount pages... OK Collapse PTE table full of compound pages.... Fail Construct PTE page table full of different PTE-mapped compound pages 512/512... OK Collapse PTE table full of different compound pages.... Fail Allocate small page... OK Share small page over fork()... OK Collapse PTE table with single page shared with parent process.... Fail Check if parent still has small page... OK Allocate huge page... OK Share huge page over fork()... OK Split huge page PMD in child process... OK Collapse PTE table full of compound pages in child.... Fail Check if parent still has huge page... OK Allocate huge page... OK Share huge page over fork()... OK Trigger CoW in 255 of 512... OK Do not collapse with max_ptes_shared exeeded.... OK Trigger CoW in 256 of 512... OK Collapse with max_ptes_shared PTEs shared.... Fail Check if parent still has huge page... OK Restore THP and khugepaged settings... OK The trace is attached. — Best Regards, Yan Zi