Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332345
b: refs/heads/master
c: d741c9c
h: refs/heads/master
i:
  332343: de7410c
v: v3
  • Loading branch information
Robin Dong authored and Linus Torvalds committed Oct 9, 2012
1 parent e359d66 commit a2e93d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 314e51b9851b4f4e8ab302243ff5a6fc6147f379
refs/heads/master: d741c9cdeee6a569dae0dbbaf028065402955b59
11 changes: 10 additions & 1 deletion trunk/mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,22 @@ void mark_page_accessed(struct page *page)
}
EXPORT_SYMBOL(mark_page_accessed);

/*
* Order of operations is important: flush the pagevec when it's already
* full, not when adding the last page, to make sure that last page is
* not added to the LRU directly when passed to this function. Because
* mark_page_accessed() (called after this when writing) only activates
* pages that are on the LRU, linear writes in subpage chunks would see
* every PAGEVEC_SIZE page activated, which is unexpected.
*/
void __lru_cache_add(struct page *page, enum lru_list lru)
{
struct pagevec *pvec = &get_cpu_var(lru_add_pvecs)[lru];

page_cache_get(page);
if (!pagevec_add(pvec, page))
if (!pagevec_space(pvec))
__pagevec_lru_add(pvec, lru);
pagevec_add(pvec, page);
put_cpu_var(lru_add_pvecs);
}
EXPORT_SYMBOL(__lru_cache_add);
Expand Down

0 comments on commit a2e93d1

Please sign in to comment.