/* 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;
}
阅读(1690) | 评论(0) | 转发(0) |