include/linux/mmzone.h
Source file repositories/reference/linux-study-clean/include/linux/mmzone.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mmzone.h- Extension
.h- Size
- 76094 bytes
- Lines
- 2394
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source 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.
- 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/spinlock.hlinux/list.hlinux/list_nulls.hlinux/wait.hlinux/bitops.hlinux/cache.hlinux/threads.hlinux/numa.hlinux/init.hlinux/seqlock.hlinux/nodemask.hlinux/pageblock-flags.hlinux/page-flags-layout.hlinux/atomic.hlinux/mm_types.hlinux/page-flags.hlinux/local_lock.hlinux/zswap.hlinux/sizes.hasm/page.hlinux/memory_hotplug.hasm/mmzone.hasm/sparsemem.h
Detected Declarations
struct free_areastruct pglist_datastruct lruvecstruct page_vma_mapped_walkstruct lru_gen_foliostruct lru_gen_mm_statestruct lru_gen_mm_walkstruct lru_gen_memcgstruct lruvecstruct per_cpu_pagesstruct per_cpu_zonestatstruct per_cpu_nodestatstruct zonestruct zonerefstruct zoneliststruct memory_failure_statsstruct mem_section_usagestruct pagestruct page_extstruct mem_sectionenum migratetypeenum numa_stat_itemenum zone_stat_itemenum node_stat_itemenum lru_listenum vmscan_throttle_stateenum lruvec_flagsenum zone_watermarksenum zone_typeenum pgdat_flagsenum zone_flagsenum kswapd_clear_hopeless_reasonenum meminit_contextfunction __dump_foliofunction migratetype_is_mergeablefunction THPsfunction bytesfunction is_file_lrufunction is_active_lrufunction lru_gen_init_pgdatfunction lru_gen_init_memcgfunction lru_gen_reparent_memcgfunction wmark_pagesfunction min_wmark_pagesfunction low_wmark_pagesfunction high_wmark_pagesfunction promo_wmark_pagesfunction zone_managed_pages
Annotated Snippet
struct free_area {
struct list_head free_list[MIGRATE_TYPES];
unsigned long nr_free;
};
struct pglist_data;
#ifdef CONFIG_NUMA
enum numa_stat_item {
NUMA_HIT, /* allocated in intended node */
NUMA_MISS, /* allocated in non intended node */
NUMA_FOREIGN, /* was intended here, hit elsewhere */
NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */
NUMA_LOCAL, /* allocation from local node */
NUMA_OTHER, /* allocation from other node */
NR_VM_NUMA_EVENT_ITEMS
};
#else
#define NR_VM_NUMA_EVENT_ITEMS 0
#endif
enum zone_stat_item {
NR_FREE_PAGES,
NR_FREE_PAGES_BLOCKS,
NR_ZONE_LRU_BASE, /* Used only for compaction and reclaim retry */
NR_ZONE_INACTIVE_ANON = NR_ZONE_LRU_BASE,
NR_ZONE_ACTIVE_ANON,
NR_ZONE_INACTIVE_FILE,
NR_ZONE_ACTIVE_FILE,
NR_ZONE_UNEVICTABLE,
NR_ZONE_WRITE_PENDING, /* Count of dirty, writeback and unstable pages */
NR_MLOCK, /* mlock()ed pages found and moved off LRU */
#if IS_ENABLED(CONFIG_ZSMALLOC)
NR_ZSPAGES, /* allocated in zsmalloc */
#endif
NR_FREE_CMA_PAGES,
#ifdef CONFIG_UNACCEPTED_MEMORY
NR_UNACCEPTED,
#endif
NR_VM_ZONE_STAT_ITEMS };
enum node_stat_item {
NR_LRU_BASE,
NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */
NR_ACTIVE_ANON, /* " " " " " */
NR_INACTIVE_FILE, /* " " " " " */
NR_ACTIVE_FILE, /* " " " " " */
NR_UNEVICTABLE, /* " " " " " */
NR_SLAB_RECLAIMABLE_B,
NR_SLAB_UNRECLAIMABLE_B,
NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
WORKINGSET_NODES,
WORKINGSET_REFAULT_BASE,
WORKINGSET_REFAULT_ANON = WORKINGSET_REFAULT_BASE,
WORKINGSET_REFAULT_FILE,
WORKINGSET_ACTIVATE_BASE,
WORKINGSET_ACTIVATE_ANON = WORKINGSET_ACTIVATE_BASE,
WORKINGSET_ACTIVATE_FILE,
WORKINGSET_RESTORE_BASE,
WORKINGSET_RESTORE_ANON = WORKINGSET_RESTORE_BASE,
WORKINGSET_RESTORE_FILE,
WORKINGSET_NODERECLAIM,
NR_ANON_MAPPED, /* Mapped anonymous pages */
NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
only modified from process context */
NR_FILE_PAGES,
NR_FILE_DIRTY,
NR_WRITEBACK,
NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */
NR_SHMEM_THPS,
NR_SHMEM_PMDMAPPED,
NR_FILE_THPS,
NR_FILE_PMDMAPPED,
NR_ANON_THPS,
NR_VMSCAN_WRITE,
NR_VMSCAN_IMMEDIATE, /* Prioritise for reclaim when writeback ends */
NR_DIRTIED, /* page dirtyings since bootup */
NR_WRITTEN, /* page writings since bootup */
NR_THROTTLED_WRITTEN, /* NR_WRITTEN while reclaim throttled */
NR_KERNEL_MISC_RECLAIMABLE, /* reclaimable non-slab kernel pages */
NR_FOLL_PIN_ACQUIRED, /* via: pin_user_page(), gup flag: FOLL_PIN */
NR_FOLL_PIN_RELEASED, /* pages returned via unpin_user_page() */
NR_VMALLOC,
NR_KERNEL_STACK_KB, /* measured in KiB */
#if IS_ENABLED(CONFIG_SHADOW_CALL_STACK)
NR_KERNEL_SCS_KB, /* measured in KiB */
#endif
NR_PAGETABLE, /* used for pagetables */
NR_SECONDARY_PAGETABLE, /* secondary pagetables, KVM & IOMMU */
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/list.h`, `linux/list_nulls.h`, `linux/wait.h`, `linux/bitops.h`, `linux/cache.h`, `linux/threads.h`, `linux/numa.h`.
- Detected declarations: `struct free_area`, `struct pglist_data`, `struct lruvec`, `struct page_vma_mapped_walk`, `struct lru_gen_folio`, `struct lru_gen_mm_state`, `struct lru_gen_mm_walk`, `struct lru_gen_memcg`, `struct lruvec`, `struct per_cpu_pages`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source 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.