当前位置:网站首页>A.1#【内存管理】——1.1.1 node:struct pglist_data
A.1#【内存管理】——1.1.1 node:struct pglist_data
2022-08-03 05:23:00 【SEVENTHD7】
typedef struct pglist_data {
struct zone node_zones[MAX_NR_ZONES];
struct zonelist node_zonelists[MAX_ZONELISTS];
int nr_zones;
#ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */
struct page *node_mem_map;
#ifdef CONFIG_PAGE_EXTENSION
struct page_ext *node_page_ext;
#endif
#endif
#ifndef CONFIG_NO_BOOTMEM
struct bootmem_data *bdata;
#endif
#ifdef CONFIG_MEMORY_HOTPLUG
/*
* Must be held any time you expect node_start_pfn, node_present_pages
* or node_spanned_pages stay constant. Holding this will also
* guarantee that any pfn_valid() stays that way.
*
* pgdat_resize_lock() and pgdat_resize_unlock() are provided to
* manipulate node_size_lock without checking for CONFIG_MEMORY_HOTPLUG.
*
* Nests above zone->lock and zone->span_seqlock
*/
spinlock_t node_size_lock;
#endif
unsigned long node_start_pfn;
unsigned long node_present_pages; /* total number of physical pages */
unsigned long node_spanned_pages; /* total size of physical page
range, including holes */
int node_id;
wait_queue_head_t kswapd_wait;
wait_queue_head_t pfmemalloc_wait;
struct task_struct *kswapd; /* Protected by
mem_hotplug_begin/end() */
int kswapd_order;
enum zone_type kswapd_classzone_idx;int kswapd_failures; /* Number of 'reclaimed == 0' runs */
#ifdef CONFIG_COMPACTION
int kcompactd_max_order;
enum zone_type kcompactd_classzone_idx;
wait_queue_head_t kcompactd_wait;
struct task_struct *kcompactd;
#endif
#ifdef CONFIG_NUMA_BALANCING
/* Lock serializing the migrate rate limiting window */
spinlock_t numabalancing_migrate_lock;/* Rate limiting time interval */
unsigned long numabalancing_migrate_next_window;/* Number of pages migrated during the rate limiting time interval */
unsigned long numabalancing_migrate_nr_pages;
#endif
/*
* This is a per-node reserve of pages that are not available
* to userspace allocations.
*/
unsigned long totalreserve_pages;#ifdef CONFIG_NUMA
/*
* zone reclaim becomes active if more unmapped pages exist.
*/
unsigned long min_unmapped_pages;
unsigned long min_slab_pages;
#endif /* CONFIG_NUMA *//* Write-intensive fields used by page reclaim */
ZONE_PADDING(_pad1_)
spinlock_t lru_lock;#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
/*
* If memory initialisation on large machines is deferred then this
* is the first PFN that needs to be initialised.
*/
unsigned long first_deferred_pfn;
/* Number of non-deferred pages */
unsigned long static_init_pgcnt;
#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */#ifdef CONFIG_TRANSPARENT_HUGEPAGE
spinlock_t split_queue_lock;
struct list_head split_queue;
unsigned long split_queue_len;
#endif/* Fields commonly accessed by the page reclaim scanner */
struct lruvec lruvec;/*
* The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
* this node's LRU. Maintained by the pageout code.
*/
unsigned int inactive_ratio;unsigned long flags;
ZONE_PADDING(_pad2_)
/* Per-node vmstats */
struct per_cpu_nodestat __percpu *per_cpu_nodestats;
atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS];
} pg_data_t;
node_zones[MAX_NR_ZONES] | 对应该node包含的各个类型的zone |
node_zonelists | 该node的备选节点及内存域列表,见下一章讲解 |
node_mem_map | linux为每个物理页分配了一个struct page的管理结构体,并形成了一个结构体数组,node_mem_map即为数组的指针;pfn_to_page和page_to_pfn都借助该数组实现。 |
nr_zones | 包含zone的个数 |
node_start_pfn | 该node中内存的起始页帧号 |
node_present_pages | 该node地址范围内的实际管理的页面数量 |
node_spanned_pages | 该node地址范围内的所有page页数,包括空洞;目前还不清楚什么情况导致与node_present_pages不同。 |
node_id | 节点标识符 |
kswapd | 负责回收该node内存的内核线程,每个node对应一个内核线程kswapd |
kswapd_wait | node的等待队列,交换守护列队进程的等待列表 |
kswapd_max_order | 需要释放的区域的长度,以页阶为单位 |
lru_lock | 用于对LRU链表并行访问时进行保护 |
lruvec | LRU链表的集合 |
flags | 内存域的当前状态, 在mmzone.h定义了zone的所有可用zone_flag |
vm_stat | node的计数 |
ZONE_PADDING宏 | 作用是让前后的成员分布在不同的cache line中, 以空间换取时间。 |
边栏推荐
- Leetcode刷题——128. 最长连续序列
- opencv
- 自我监督学习和BERT模型
- 中国食品微生物检测行业深度监测及投资战略规划建议报告2022~2028年
- Ansible installation and deployment detailed process, basic operation of configuration inventory
- 中国磷化铟晶圆行业发展前景与投资规划分析报告2022~2028年
- HoloLens联合发明人:打造理想的全天AR需要解决这些问题
- Hook初探索
- 自监督论文阅读笔记Reading and Writing: Discriminative and Generative Modelingfor Self-Supervised Text Recogn
- EIP-5058 能否防止NFT项目方提桶跑路?
猜你喜欢
Convolutional Nerual Nertwork(CNN)
自监督论文阅读笔记 Ship Detection in Sentinel 2 Multi-Spectral Images with Self-Supervised Learning
IPC 通信 - IPC
Router-view
自监督论文阅读笔记Efficient Self-supervised Vision Pretraining with Local Masked Reconstruction
自监督论文阅读笔记 Self-Supervised Deep Learning for Vehicle Detection in High-Resolution Satellite Imagery
自监督论文阅读笔记DisCo: Remedy Self-supervised Learning on Lightweight Models with Distilled Contrastive
Oracle 注释详解(--、/**/、rem)
opencv透视变化
当奈飞的NFT忘记了web2的业务安全
随机推荐
卷积神经网络入门
Oracle null 有哪些注意事项【面试题】
【源码解读】你买的NFT到底是什么?
Oracle 分区索引详解(local、global)
Oracle 日历表详解(含节假日)
spark sql 报错 Can‘t zip RDDs with unequal numbers of partitions
中国水产养殖行业市场投资分析及未来风险预测报告2022~2028年
中国认证认可服务行业“十四五”发展规划及经营模式分析报告2022~2028年
controller层到底能不能用@Transactional注解?
SAP HANA 新增一列时报错详解
当奈飞的NFT忘记了web2的业务安全
Let small program development into ` tailwind jit ` era
UPC-Longest X
MySQL 排序
Mysql 外键详解(Foreign Key)
微信小程序 自定义tabBar
Invalid signature file digest for Manifest main attributes解决方法
自监督论文阅读笔记Index Your Position: A Novel Self-Supervised Learning Method for Remote Sensing Images Sema
【 Nmap and Metasploit common commands 】
Kettle 从资源库中载入新的转换出错(Invalid byte 1 of 1-byte UTF-8 sequence)