- 论坛徽章:
- 16
|
本帖最后由 embeddedlwp 于 2012-05-29 13:09 编辑
回复 37# firkraag
在filemap的page fault中:
do_linear_fault->__do_fault->filemap_fault->page_cache_read:- static int fastcall page_cache_read(struct file * file, pgoff_t offset)
- {
- struct address_space *mapping = file->f_mapping;
- struct page *page;
- int ret;
- do {
- page = page_cache_alloc_cold(mapping);
- if (!page)
- return -ENOMEM;
- ret = add_to_page_cache_lru(page, mapping, offset, GFP_KERNEL);
- if (ret == 0)
- ret = mapping->a_ops->readpage(file, page);
- else if (ret == -EEXIST)
- ret = 0; /* losing race to add is OK */
- page_cache_release(page);
- } while (ret == AOP_TRUNCATED_PAGE);
-
- return ret;
- }
复制代码 在add_to_page_cache_lru函数中把page添加进了inactive链表,怎么在page_cache_release函数中又从链表移除了?
在__do_fault中会判断,如果这个page是anon的,那么直接加到active,但是没看到filemap的page在page_cache_release后加到哪里了
还有为什么在__do_fault中判断是不是anon的,do_linear_fault这条path应该就是为filemap准备的啊,anon page有自己的处理函数do_anonymous_page啊!
|
|