All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] uprobes/core: Make background page replacement logic account for rss_stat counters
@ 2012-04-11 10:35 ` Srikar Dronamraju
  0 siblings, 0 replies; 10+ messages in thread
From: Srikar Dronamraju @ 2012-04-11 10:35 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Andrew Morton, Linus Torvalds, Ananth N Mavinakayanahalli,
	Jim Keniston, LKML, Linux-mm, Oleg Nesterov, Andi Kleen,
	Christoph Hellwig, Steven Rostedt, Arnaldo Carvalho de Melo,
	Masami Hiramatsu, Thomas Gleixner, Anton Arapov

From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

Background page replacement logic adds a new anonymous page instead of a
filebacked(while inserting a breakpoint) / anonymous page(while removing a
breakpoint). Hence logic should take care to update the rss_stat counters
accordingly. This bug became apparent courtesy commit c3f0327f8e9d7

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
 kernel/events/uprobes.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 29e881b..c5caeec 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -160,6 +160,11 @@ static int __replace_page(struct vm_area_struct *vma, struct page *page, struct 
 	get_page(kpage);
 	page_add_new_anon_rmap(kpage, vma, addr);
 
+	if (!PageAnon(page)) {
+		dec_mm_counter(mm, MM_FILEPAGES);
+		inc_mm_counter(mm, MM_ANONPAGES);
+	}
+
 	flush_cache_page(vma, addr, pte_pfn(*ptep));
 	ptep_clear_flush(vma, addr, ptep);
 	set_pte_at_notify(mm, addr, ptep, mk_pte(kpage, vma->vm_page_prot));


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-04-15  6:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-11 10:35 [PATCH 1/2] uprobes/core: Make background page replacement logic account for rss_stat counters Srikar Dronamraju
2012-04-11 10:35 ` Srikar Dronamraju
2012-04-11 10:35 ` [PATCH 2/2] uprobes/core: Decrement uprobe count before the pages are unmapped Srikar Dronamraju
2012-04-11 10:35   ` Srikar Dronamraju
2012-04-14 18:26   ` [tip:perf/uprobes] " tip-bot for Srikar Dronamraju
2012-04-14 18:26     ` tip-bot for Srikar Dronamraju
2012-04-15  6:29     ` Ingo Molnar
2012-04-15  6:29       ` Ingo Molnar
2012-04-14 18:25 ` [tip:perf/uprobes] uprobes/core: Make background page replacement logic account for rss_stat counters tip-bot for Srikar Dronamraju
2012-04-14 18:25   ` tip-bot for Srikar Dronamraju

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.