mm/swap_state.c
Source file repositories/reference/linux-study-clean/mm/swap_state.c
File Facts
- System
- Linux kernel
- Corpus path
mm/swap_state.c- Extension
.c- Size
- 31293 bytes
- Lines
- 1044
- Domain
- Core OS
- Bucket
- Memory Management
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/mm.hlinux/gfp.hlinux/kernel_stat.hlinux/mempolicy.hlinux/swap.hlinux/leafops.hlinux/init.hlinux/pagemap.hlinux/folio_batch.hlinux/backing-dev.hlinux/blkdev.hlinux/migrate.hlinux/vmalloc.hlinux/huge_mm.hlinux/shmem_fs.hinternal.hswap_table.hswap.h
Detected Declarations
function show_swap_cache_infofunction usefunction swap_cache_has_foliofunction __swap_cache_add_checkfunction __swap_cache_do_add_foliofunction __swap_cache_add_foliofunction __swap_cache_do_del_foliofunction __swap_cache_del_foliofunction swap_cache_del_foliofunction __swap_cache_replace_foliofunction replacedfunction IOfunction folio_free_swapfunction free_folio_and_swap_cachefunction free_pages_and_swap_cachefunction swap_use_vma_readaheadfunction swap_update_readaheadfunction __swapin_nr_pagesfunction swapin_nr_pagesfunction swap_vma_ra_winfunction vma_ra_enabled_showfunction vma_ra_enabled_storefunction swap_initmodule init swap_init
Annotated Snippet
subsys_initcall(swap_init);
#endif
Annotation
- Immediate include surface: `linux/mm.h`, `linux/gfp.h`, `linux/kernel_stat.h`, `linux/mempolicy.h`, `linux/swap.h`, `linux/leafops.h`, `linux/init.h`, `linux/pagemap.h`.
- Detected declarations: `function show_swap_cache_info`, `function use`, `function swap_cache_has_folio`, `function __swap_cache_add_check`, `function __swap_cache_do_add_folio`, `function __swap_cache_add_folio`, `function __swap_cache_do_del_folio`, `function __swap_cache_del_folio`, `function swap_cache_del_folio`, `function __swap_cache_replace_folio`.
- Atlas domain: Core OS / Memory Management.
- Implementation status: integration implementation candidate.
- 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.