[PATCH 02/21] mm: zap_pte_range dec rss

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Small adjustment: zap_pte_range decrement its rss counts from 0 then
finally add, avoiding negations - we don't have or need a sub_mm_rss.

Signed-off-by: Hugh Dickins <[email protected]>
---

 mm/memory.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- mm01/mm/memory.c	2005-10-11 23:53:00.000000000 +0100
+++ mm02/mm/memory.c	2005-10-11 23:53:17.000000000 +0100
@@ -609,13 +609,13 @@ static void zap_pte_range(struct mmu_gat
 				set_pte_at(mm, addr, pte,
 					   pgoff_to_pte(page->index));
 			if (PageAnon(page))
-				anon_rss++;
+				anon_rss--;
 			else {
 				if (pte_dirty(ptent))
 					set_page_dirty(page);
 				if (pte_young(ptent))
 					mark_page_accessed(page);
-				file_rss++;
+				file_rss--;
 			}
 			page_remove_rmap(page);
 			tlb_remove_page(tlb, page);
@@ -632,7 +632,7 @@ static void zap_pte_range(struct mmu_gat
 		pte_clear_full(mm, addr, pte, tlb->fullmm);
 	} while (pte++, addr += PAGE_SIZE, addr != end);
 
-	add_mm_rss(mm, -file_rss, -anon_rss);
+	add_mm_rss(mm, file_rss, anon_rss);
 	pte_unmap(pte - 1);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux