Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94003
b: refs/heads/master
c: ac6aadb
h: refs/heads/master
i:
  94001: af39a05
  93999: 02a0858
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Apr 28, 2008
1 parent aea8675 commit 95e8114
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 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: f05111f50105ac479a008cf85749cf9c956453ea
refs/heads/master: ac6aadb24b7d4f0e54246732e221c102073412bf
2 changes: 1 addition & 1 deletion trunk/include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ extern void activate_page(struct page *);
extern void mark_page_accessed(struct page *);
extern void lru_add_drain(void);
extern int lru_add_drain_all(void);
extern int rotate_reclaimable_page(struct page *page);
extern void rotate_reclaimable_page(struct page *page);
extern void swap_setup(void);

/* linux/mm/vmscan.c */
Expand Down
10 changes: 6 additions & 4 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,12 @@ EXPORT_SYMBOL(unlock_page);
*/
void end_page_writeback(struct page *page)
{
if (!TestClearPageReclaim(page) || rotate_reclaimable_page(page)) {
if (!test_clear_page_writeback(page))
BUG();
}
if (TestClearPageReclaim(page))
rotate_reclaimable_page(page);

if (!test_clear_page_writeback(page))
BUG();

smp_mb__after_clear_bit();
wake_up_page(page, PG_writeback);
}
Expand Down
37 changes: 12 additions & 25 deletions trunk/mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,34 +132,21 @@ static void pagevec_move_tail(struct pagevec *pvec)
* Writeback is about to end against a page which has been marked for immediate
* reclaim. If it still appears to be reclaimable, move it to the tail of the
* inactive list.
*
* Returns zero if it cleared PG_writeback.
*/
int rotate_reclaimable_page(struct page *page)
void rotate_reclaimable_page(struct page *page)
{
struct pagevec *pvec;
unsigned long flags;

if (PageLocked(page))
return 1;
if (PageDirty(page))
return 1;
if (PageActive(page))
return 1;
if (!PageLRU(page))
return 1;

page_cache_get(page);
local_irq_save(flags);
pvec = &__get_cpu_var(lru_rotate_pvecs);
if (!pagevec_add(pvec, page))
pagevec_move_tail(pvec);
local_irq_restore(flags);

if (!test_clear_page_writeback(page))
BUG();
if (!PageLocked(page) && !PageDirty(page) && !PageActive(page) &&
PageLRU(page)) {
struct pagevec *pvec;
unsigned long flags;

return 0;
page_cache_get(page);
local_irq_save(flags);
pvec = &__get_cpu_var(lru_rotate_pvecs);
if (!pagevec_add(pvec, page))
pagevec_move_tail(pvec);
local_irq_restore(flags);
}
}

/*
Expand Down

0 comments on commit 95e8114

Please sign in to comment.