tools/testing/selftests/mm/gup_longterm.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/mm/gup_longterm.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/mm/gup_longterm.c- Extension
.c- Size
- 11717 bytes
- Lines
- 525
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdlib.hstring.hstdbool.hstdint.hunistd.herrno.hfcntl.hassert.hsys/mman.hsys/ioctl.hsys/vfs.hlinux/magic.hlinux/memfd.hlocal_config.hliburing.h../../../../mm/gup_test.hkselftest.hvm_util.h
Detected Declarations
struct test_caseenum test_typefunction get_fs_typefunction fs_is_unknownfunction fs_supports_writable_longterm_pinningfunction do_testfunction run_with_memfdfunction run_with_tmpfilefunction run_with_local_tmpfilefunction run_with_memfd_hugetlbfunction test_shared_rw_pinfunction test_shared_rw_fast_pinfunction test_shared_ro_pinfunction test_shared_ro_fast_pinfunction test_private_rw_pinfunction test_private_rw_fast_pinfunction test_private_ro_pinfunction test_private_ro_fast_pinfunction test_shared_iouringfunction test_private_iouringfunction run_test_casefunction tests_per_test_casefunction main
Annotated Snippet
struct test_case {
const char *desc;
test_fn fn;
};
static void test_shared_rw_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RW, true);
}
static void test_shared_rw_fast_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RW_FAST, true);
}
static void test_shared_ro_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RO, true);
}
static void test_shared_ro_fast_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RO_FAST, true);
}
static void test_private_rw_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RW, false);
}
static void test_private_rw_fast_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RW_FAST, false);
}
static void test_private_ro_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RO, false);
}
static void test_private_ro_fast_pin(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_RO_FAST, false);
}
#ifdef LOCAL_CONFIG_HAVE_LIBURING
static void test_shared_iouring(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_IOURING, true);
}
static void test_private_iouring(int fd, size_t size)
{
do_test(fd, size, TEST_TYPE_IOURING, false);
}
#endif /* LOCAL_CONFIG_HAVE_LIBURING */
static const struct test_case test_cases[] = {
{
"R/W longterm GUP pin in MAP_SHARED file mapping",
test_shared_rw_pin,
},
{
"R/W longterm GUP-fast pin in MAP_SHARED file mapping",
test_shared_rw_fast_pin,
},
{
"R/O longterm GUP pin in MAP_SHARED file mapping",
test_shared_ro_pin,
},
{
"R/O longterm GUP-fast pin in MAP_SHARED file mapping",
test_shared_ro_fast_pin,
},
{
"R/W longterm GUP pin in MAP_PRIVATE file mapping",
test_private_rw_pin,
},
{
"R/W longterm GUP-fast pin in MAP_PRIVATE file mapping",
test_private_rw_fast_pin,
},
{
"R/O longterm GUP pin in MAP_PRIVATE file mapping",
test_private_ro_pin,
},
{
"R/O longterm GUP-fast pin in MAP_PRIVATE file mapping",
test_private_ro_fast_pin,
},
Annotation
- Immediate include surface: `stdlib.h`, `string.h`, `stdbool.h`, `stdint.h`, `unistd.h`, `errno.h`, `fcntl.h`, `assert.h`.
- Detected declarations: `struct test_case`, `enum test_type`, `function get_fs_type`, `function fs_is_unknown`, `function fs_supports_writable_longterm_pinning`, `function do_test`, `function run_with_memfd`, `function run_with_tmpfile`, `function run_with_local_tmpfile`, `function run_with_memfd_hugetlb`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.