博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
页描述符解读
阅读量:4153 次
发布时间:2019-05-25

本文共 1769 字,大约阅读时间需要 5 分钟。

每个物理页关联一个page描述符,这样通过软件形式维护物理内存:struct page {
第1个 unsigned long flags; 第2个 union {  struct address_space *mapping;  void *s_mem;  atomic_t compound_mapcount; }; 第3个 union {  pgoff_t index;  void *freelist; };   union {第4个#if defined(CONFIG_HAVE_CMPXCHG_DOUBLE) && defined(CONFIG_HAVE_ALIGNED_STRUCT_PAGE)  unsigned long counters;#else  unsigned counters;#endif  struct {   union {    atomic_t _mapcount;    unsigned int active;    struct {     unsigned inuse:16;     unsigned objects:15;     unsigned frozen:1;    };    int units;   };   atomic_t _refcount;  }; };      union {第5个  struct list_head lru;  struct dev_pagemap *pgmap;   struct {   struct page *next;#ifdef CONFIG_64BIT   int pages;   int pobjects;#else   short int pages;   short int pobjects;#endif  };     struct rcu_head rcu_head;第6个   struct {第7个   unsigned long compound_head; #ifdef CONFIG_64BIT   unsigned int compound_dtor;   unsigned int compound_order;#else   unsigned short int compound_dtor;   unsigned short int compound_order;#endif  };     第8个#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS  struct {   unsigned long __pad;   pgtable_t pmd_huge_pte;  };#endif };    union {第9个  unsigned long private;#if USE_SPLIT_PTE_PTLOCKS#if ALLOC_SPLIT_PTLOCKS  spinlock_t *ptl;#else  spinlock_t ptl;#endif#endif  struct kmem_cache *slab_cache; };   第10个#ifdef CONFIG_MEMCG struct mem_cgroup *mem_cgroup;#endif   第11个#if defined(WANT_PAGE_VIRTUAL) void *virtual;#endif   第12个#ifdef CONFIG_KMEMCHECK void *shadow;#endif   第13个 #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS int _last_cpupid;#endif}第一个成员flags给出了页相关标识,比如页状态啊。 第二个是一个联合体,其给出在一个页用于不同的目的时,不同成员标记不同目的。mapping用于当页被映射 地址空间时起作用;而s_mem是指,这个页被用于slab缓存了。而compound_mapcount是用于当多个页作为 一个整体看待时,compound_mapcount给出这些页被映射到页表结构的进程数目。  
 
 
 
 

转载地址:http://dzhti.baihongyu.com/

你可能感兴趣的文章
常见的类别型数据列编码方法汇总
查看>>
牛顿法和最优化
查看>>
特征金字塔网络总结
查看>>
修改pytorch和Keras预训练模型路径
查看>>
yolov4中的route和shortcut层
查看>>
Pytorch中loss计算解析
查看>>
BF16格式数据
查看>>
TypeError: ufunc ‘true_divide‘ output (typecode ‘d‘) could not be coerced to provided outp
查看>>
记录Ubuntu18.04-cuda10.1-opencv4配置caffe过程
查看>>
tensorflow2.2中定义的ResNet和ResneXt中的bottleneck结构
查看>>
Pytorch中nn.Conv2d的dilation
查看>>
onnx2caffe:KeyError: ‘broadcast‘
查看>>
感受野知识点总结
查看>>
GoogleNet总结
查看>>
pandas学习笔记-------时间戳转日期时间型数据
查看>>
python 打印类的所有属性和方法
查看>>
python 去掉字符串头尾及内部指定字符
查看>>
python 字符串大小写转换
查看>>
pandas学习笔记---------时间间隔运算
查看>>
python解析二进制文件以及不同进制数值间的转换
查看>>