<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Hugh Dickins &lt;hugh@veritas.com&gt;

Remove the three get_mm_counter(mm, rss) tests from rmap.c: there was a
time when testing rss was important to avoid a particular race between
dup_mmap and the anonmm rmap; but now it's just a rather silly pseudo-
optimization, made even more obscure by the get_mm_counter macro.

Signed-off-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 mm/rmap.c |    7 +------
 1 files changed, 1 insertion(+), 6 deletions(-)

diff -puN mm/rmap.c~rmap-dont-test-rss mm/rmap.c
--- devel/mm/rmap.c~rmap-dont-test-rss	2005-07-08 22:41:36.000000000 -0700
+++ devel-akpm/mm/rmap.c	2005-07-08 22:41:36.000000000 -0700
@@ -289,8 +289,6 @@ static int page_referenced_one(struct pa
 	pte_t *pte;
 	int referenced = 0;
 
-	if (!get_mm_counter(mm, rss))
-		goto out;
 	address = vma_address(page, vma);
 	if (address == -EFAULT)
 		goto out;
@@ -521,8 +519,6 @@ static int try_to_unmap_one(struct page 
 	pte_t pteval;
 	int ret = SWAP_AGAIN;
 
-	if (!get_mm_counter(mm, rss))
-		goto out;
 	address = vma_address(page, vma);
 	if (address == -EFAULT)
 		goto out;
@@ -770,8 +766,7 @@ static int try_to_unmap_file(struct page
 			if (vma-&gt;vm_flags &amp; (VM_LOCKED|VM_RESERVED))
 				continue;
 			cursor = (unsigned long) vma-&gt;vm_private_data;
-			while (get_mm_counter(vma-&gt;vm_mm, rss) &amp;&amp;
-				cursor &lt; max_nl_cursor &amp;&amp;
+			while ( cursor &lt; max_nl_cursor &amp;&amp;
 				cursor &lt; vma-&gt;vm_end - vma-&gt;vm_start) {
 				try_to_unmap_cluster(cursor, &amp;mapcount, vma);
 				cursor += CLUSTER_SIZE;
_
</pre></body></html>