diff options
author | Tony Luck <tony.luck@intel.com> | 2005-10-20 13:41:44 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-10-20 13:41:44 -0400 |
commit | 9cec58dc138d6fcad9f447a19c8ff69f6540e667 (patch) | |
tree | 4fe1cca94fdba8b705c87615bee06d3346f687ce /mm/vmscan.c | |
parent | 17e5ad6c0ce5a970e2830d0de8bdd60a2f077d38 (diff) | |
parent | ac9b9c667c2e1194e22ebe0a441ae1c37aaa9b90 (diff) |
Update from upstream with manual merge of Yasunori Goto's
changes to swiotlb.c made in commit 281dd25cdc0d6903929b79183816d151ea626341
since this file has been moved from arch/ia64/lib/swiotlb.c to
lib/swiotlb.c
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 0ea71e887bb6..64f9570cff56 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -511,10 +511,11 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc) | |||
511 | * PageDirty _after_ making sure that the page is freeable and | 511 | * PageDirty _after_ making sure that the page is freeable and |
512 | * not in use by anybody. (pagecache + us == 2) | 512 | * not in use by anybody. (pagecache + us == 2) |
513 | */ | 513 | */ |
514 | if (page_count(page) != 2 || PageDirty(page)) { | 514 | if (unlikely(page_count(page) != 2)) |
515 | write_unlock_irq(&mapping->tree_lock); | 515 | goto cannot_free; |
516 | goto keep_locked; | 516 | smp_rmb(); |
517 | } | 517 | if (unlikely(PageDirty(page))) |
518 | goto cannot_free; | ||
518 | 519 | ||
519 | #ifdef CONFIG_SWAP | 520 | #ifdef CONFIG_SWAP |
520 | if (PageSwapCache(page)) { | 521 | if (PageSwapCache(page)) { |
@@ -538,6 +539,10 @@ free_it: | |||
538 | __pagevec_release_nonlru(&freed_pvec); | 539 | __pagevec_release_nonlru(&freed_pvec); |
539 | continue; | 540 | continue; |
540 | 541 | ||
542 | cannot_free: | ||
543 | write_unlock_irq(&mapping->tree_lock); | ||
544 | goto keep_locked; | ||
545 | |||
541 | activate_locked: | 546 | activate_locked: |
542 | SetPageActive(page); | 547 | SetPageActive(page); |
543 | pgactivate++; | 548 | pgactivate++; |