Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9902
b: refs/heads/master
c: 3d80636
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 17, 2005
1 parent 4de8184 commit 254ab28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: 688ce17b8599abc548b406c00e4d18ae0dec954f
refs/heads/master: 3d80636a0d5f056ffc26472d05b6027a7a9f6e1c
13 changes: 9 additions & 4 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,11 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
* PageDirty _after_ making sure that the page is freeable and
* not in use by anybody. (pagecache + us == 2)
*/
if (page_count(page) != 2 || PageDirty(page)) {
write_unlock_irq(&mapping->tree_lock);
goto keep_locked;
}
if (unlikely(page_count(page) != 2))
goto cannot_free;
smp_rmb();
if (unlikely(PageDirty(page)))
goto cannot_free;

#ifdef CONFIG_SWAP
if (PageSwapCache(page)) {
Expand All @@ -538,6 +539,10 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
__pagevec_release_nonlru(&freed_pvec);
continue;

cannot_free:
write_unlock_irq(&mapping->tree_lock);
goto keep_locked;

activate_locked:
SetPageActive(page);
pgactivate++;
Expand Down

0 comments on commit 254ab28

Please sign in to comment.