Chinaunix首页 | 论坛 | 博客
  • 博客访问: 924314
  • 博文数量: 63
  • 博客积分: 568
  • 博客等级: 中士
  • 技术积分: 3435
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-05 11:44
文章分类
文章存档

2016年(4)

2015年(6)

2014年(3)

2013年(27)

2012年(23)

分类: LINUX

2012-10-09 22:04:05

/* Called without lock on whether page is mapped, so answer is unstable */
static inline int page_mapping_inuse(struct page *page)
{
    struct address_space *mapping;

    /* Page is in somebody's page tables. */
    该处检查是否被映射到了某个进程的页表项中了
    if (page_mapped(page))
        return 1;

    /* Be more reluctant to reclaim swapcache than pagecache */
    如果页面在交换缓冲中,也返回1
    if (PageSwapCache(page))
        return 1;

    mapping = page_mapping(page);
    if (!mapping)
        return 0;

    /* File is mmap'd by somebody? */
    有进程映射在该高速缓冲去中
    return mapping_mapped(mapping);
}

static inline int page_mapped(struct page *page)
{
    return atomic_read(&(page)->_mapcount) >= 0;
}
阅读(1647) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~