mm/gup_test.c
Source file repositories/reference/linux-study-clean/mm/gup_test.c
File Facts
- System
- Linux kernel
- Corpus path
mm/gup_test.c- Extension
.c- Size
- 9213 bytes
- Lines
- 397
- Domain
- Core OS
- Bucket
- Memory Management
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/mm.hlinux/slab.hlinux/uaccess.hlinux/ktime.hlinux/debugfs.hlinux/highmem.hgup_test.h
Detected Declarations
function put_back_pagesfunction verify_dma_pinnedfunction WARNfunction dump_pages_testfunction __gup_test_ioctlfunction pin_longterm_test_stopfunction pin_longterm_test_startfunction pin_longterm_test_readfunction pin_longterm_test_ioctlfunction gup_test_ioctlfunction gup_test_releasefunction gup_test_init
Annotated Snippet
static const struct file_operations gup_test_fops = {
.open = nonseekable_open,
.unlocked_ioctl = gup_test_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.release = gup_test_release,
};
static int __init gup_test_init(void)
{
debugfs_create_file_unsafe("gup_test", 0600, NULL, NULL,
&gup_test_fops);
return 0;
}
late_initcall(gup_test_init);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/mm.h`, `linux/slab.h`, `linux/uaccess.h`, `linux/ktime.h`, `linux/debugfs.h`, `linux/highmem.h`, `gup_test.h`.
- Detected declarations: `function put_back_pages`, `function verify_dma_pinned`, `function WARN`, `function dump_pages_test`, `function __gup_test_ioctl`, `function pin_longterm_test_stop`, `function pin_longterm_test_start`, `function pin_longterm_test_read`, `function pin_longterm_test_ioctl`, `function gup_test_ioctl`.
- Atlas domain: Core OS / Memory Management.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.