Commit:     5a9bbdcd29adbb786c53eba1dfc3c2d256020d6b
Parent:     9eccf2a816ed0aad82b577de6a40cd098ad41944
Author:     Hugh Dickins <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 22:29:23 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Feb 5 09:44:18 2008 -0800

    mm: don't waste swap on locked pages
    try_to_unmap always fails on a page found in a VM_LOCKED vma (unless
    migrating), and recycles it back to the active list.  But if it's an
    anonymous page, we've already allocated swap to it: just wasting swap.
    Spot locked pages in page_referenced_one and treat them as referenced.
    Signed-off-by: Hugh Dickins <[EMAIL PROTECTED]>
    Tested-by: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
    Cc: Ethan Solomita <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 mm/rmap.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 0334c8f..57ad276 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -283,7 +283,10 @@ static int page_referenced_one(struct page *page,
        if (!pte)
                goto out;
-       if (ptep_clear_flush_young(vma, address, pte))
+       if (vma->vm_flags & VM_LOCKED) {
+               referenced++;
+               *mapcount = 1;  /* break early from loop */
+       } else if (ptep_clear_flush_young(vma, address, pte))
        /* Pretend the page is referenced if the task has the
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to