Skip to content

Commit

Permalink
[S390] reference bit testing for unmapped pages
Browse files Browse the repository at this point in the history
On x86 a page without a mapper is by definition not referenced / old.
The s390 architecture keeps the reference bit in the storage key and
the current code will check the storage key for page without a mapper.
This leads to an interesting effect: the first time an s390 system
needs to write pages to swap it only finds referenced pages. This
causes a lot of pages to get added and written to the swap device.
To avoid this behaviour change page_referenced to query the storage
key only if there is a mapper of the page.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed Jul 24, 2011
1 parent f433c4a commit 50a1598
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,11 @@ int page_referenced(struct page *page,
vm_flags);
if (we_locked)
unlock_page(page);

if (page_test_and_clear_young(page_to_pfn(page)))
referenced++;
}
out:
if (page_test_and_clear_young(page_to_pfn(page)))
referenced++;

return referenced;
}

Expand Down

0 comments on commit 50a1598

Please sign in to comment.