• Pavel Tatashin's avatar
    selftests/vm: gup_test: test faulting in kernel, and verify pinnable pages · e44605a8
    Pavel Tatashin authored
    When pages are pinned they can be faulted in userland and migrated, and
    they can be faulted right in kernel without migration.
    
    In either case, the pinned pages must end-up being pinnable (not
    movable).
    
    Add a new test to gup_test, to help verify that the gup/pup
    (get_user_pages() / pin_user_pages()) behavior with respect to pinnable
    and movable pages is reasonable and correct.  Specifically, provide a
    way to:
    
    1) Verify that only "pinnable" pages are pinned.  This is checked
       automatically for you.
    
    2) Verify that gup/pup performance is reasonable.  This requires
       comparing benchmarks between doing gup/pup on pages that have been
       pre-faulted in from user space, vs.  doing gup/pup on pages that are
       not faulted in until gup/pup time (via FOLL_TOUCH).  This decision is
       controlled with the new -z command line option.
    
    Link: https://lkml.kernel.org/r/20210215161349.246722-15-pasha.tatashin@soleen.com
    Signed-off-by: Pavel T...
    e44605a8
gup_test.c 5.59 KB