Numabalance 流程代码#6
Draft
jackYoung0915 wants to merge 2 commits into
Draft
Conversation
Detailed code-level analysis of the Linux kernel's Automatic NUMA Balancing mechanism, covering: - Overall architecture and data flow - Core data structures (task_struct, mm_struct, vma_numab_state, numa_group) - Periodic scan triggering (task_tick_numa) - VMA scanning and PTE marking (task_numa_work / change_prot_numa) - NUMA hint fault handling (do_numa_page / numa_migrate_check) - Fault statistics and placement decisions (task_numa_fault / task_numa_placement) - Task migration execution (task_numa_migrate / task_numa_compare) - NUMA Group mechanism for shared memory workloads - Adaptive scan period adjustment (update_task_scan_period) - Memory migration decision (should_numa_migrate_memory with two-stage filter) - Memory Tiering support (NUMA_BALANCING_MEMORY_TIERING) - Key sysctl parameters reference - Complete flow diagrams Co-authored-by: Slim6882 <jackYoung0915@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
Root cause analysis for why programs configured to use remote NUMA node memory may see uneven distribution: 1. MPOL_BIND vs MPOL_INTERLEAVE confusion (BIND follows zonelist order) 2. NUMA Balancing auto-migrating pages back to local node (MPOL_F_MORON) 3. THP allocation bias toward local node 4. Zonelist fallback ordering in buddy allocator 5. Kernel internal allocations ignoring user mempolicy 6. First-touch allocation before mempolicy is set Includes diagnostic methods (numastat, numa_maps, vmstat), correct usage examples with code, and a decision tree for choosing the right memory policy. Co-authored-by: Slim6882 <jackYoung0915@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create a comprehensive analysis document for the Linux kernel's NUMA Balancing flow.
This document provides a deep dive into the NUMA balancing mechanism, detailing its five-stage process (periodic scan, PTE marking, NUMA hint fault handling, fault statistics, and task migration), core data structures, NUMA Group coordination, adaptive scan period adjustment, and Memory Tiering support.