• Zi Yan's avatar
    mm: huge_memory: a new debugfs interface for splitting THP tests · fa6c0231
    Zi Yan authored
    We did not have a direct user interface of splitting the compound page
    backing a THP and there is no need unless we want to expose the THP
    implementation details to users.  Make <debugfs>/split_huge_pages accept a
    new command to do that.
    
    By writing "<pid>,<vaddr_start>,<vaddr_end>" to
    <debugfs>/split_huge_pages, THPs within the given virtual address range
    from the process with the given pid are split. It is used to test
    split_huge_page function. In addition, a selftest program is added to
    tools/testing/selftests/vm to utilize the interface by splitting
    PMD THPs and PTE-mapped THPs.
    
    This does not change the old behavior, i.e., writing 1 to the interface
    to split all THPs in the system.
    
    Link: https://lkml.kernel.org/r/20210331235309.332292-1-zi.yan@sent.comSigned-off-by: default avatarZi Yan <ziy@nvidia.com>
    Reviewed-by: default avatarYang Shi <shy828301@gmail.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: John Hubbard <jhubbard@nvidia.com>
    Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Mika Penttila <mika.penttila@nextfour.com>
    Cc: Sandipan Das <sandipan@linux.ibm.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    fa6c0231
Makefile 4.69 KB