diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-18 17:16:06 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-18 17:16:06 -0400 |
| commit | 5a476deff3d17093da39c4eccb2692ba714dcb11 (patch) | |
| tree | 16f5c745a3c8ac780a218ad3d43e32f33164bcf5 /mm/vmscan.c | |
| parent | dd4efa44ebf2a8a0e5edf60a53eadec981b4b10a (diff) | |
| parent | 39ca371c45b04cd50d0974030ae051906fc516b6 (diff) | |
Merge branch 'master'
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++; |
