[PATCH] mm: fix accounting on page_remove_rmap()

2013-09-02 Thread Kirill A. Shutemov
There's typo in page_remove_rmap(): we increase NR_ANON_PAGES counter
instead of decreasing it. Let's fix this.

Signed-off-by: Kirill A. Shutemov 
Reported-by: Ning Qu 
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 52cc59a..6219f07 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1156,7 +1156,7 @@ void page_remove_rmap(struct page *page)
__dec_zone_page_state(page,
  NR_ANON_TRANSPARENT_HUGEPAGES);
__mod_zone_page_state(page_zone(page), NR_ANON_PAGES,
-   hpage_nr_pages(page));
+   -hpage_nr_pages(page));
} else {
__dec_zone_page_state(page, NR_FILE_MAPPED);
mem_cgroup_dec_page_stat(page, MEM_CGROUP_STAT_FILE_MAPPED);
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mm: fix accounting on page_remove_rmap()

2013-09-02 Thread Kirill A. Shutemov
There's typo in page_remove_rmap(): we increase NR_ANON_PAGES counter
instead of decreasing it. Let's fix this.

Signed-off-by: Kirill A. Shutemov kirill.shute...@linux.intel.com
Reported-by: Ning Qu qun...@google.com
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 52cc59a..6219f07 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1156,7 +1156,7 @@ void page_remove_rmap(struct page *page)
__dec_zone_page_state(page,
  NR_ANON_TRANSPARENT_HUGEPAGES);
__mod_zone_page_state(page_zone(page), NR_ANON_PAGES,
-   hpage_nr_pages(page));
+   -hpage_nr_pages(page));
} else {
__dec_zone_page_state(page, NR_FILE_MAPPED);
mem_cgroup_dec_page_stat(page, MEM_CGROUP_STAT_FILE_MAPPED);
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/