java pagecache_Page Cache(页缓存)

address_space

struct address_space {

struct inode *host; /* owning inode */

struct radix_tree_root page_tree; /* radix tree of all pages */

spinlock_t tree_lock; /* page_tree lock */

unsigned int i_mmap_writable; /* VM_SHARED ma count */

struct prio_tree_root i_mmap; /* list of all mappings */

struct list_head i_mmap_nonlinear; /* VM_NONLINEAR ma list */

spinlock_t i_mmap_lock; /* i_mmap lock */

atomic_t truncate_count; /* truncate re count */

unsigned long nrpages; /* total number of pages */

pgoff_t writeback_index; /* writeback start offset */

struct address_space_operations *a_ops; /* operations table */

unsigned long flags; /* gfp_mask and error flags */

struct backing_dev_info *backing_dev_info; /* read-ahead information */

spinlock_t private_lock; /* private lock */

struct list_head private_list; /* private list */

struct address_space *assoc_mapping; /* associated buffers */

};

其中 host域指向对应的inode对象,host有可能为NULL,这意味着这个address_space不是和一个文件关联,而是和swap area相关,swap是Linux中将匿名内存(比如进程的堆、栈等,没有一个文件作为back store)置换到swap area(比如swap分区)从而释放物理内存的一种机制。page_tree保存了该page cache中所有的page,使用基数树(radix Tree)来存储。i_mmap是保存了所有映射到当前page cache(物理的)的虚拟内存区域(VMA)。nrpages是当前address_space中page的数量。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值