Thread (13 messages) 13 messages, 5 authors, 2012-03-14

Re: [patch 2/2] mm: memcg: count pte references from every member of the reclaimed hierarchy

From: KAMEZAWA Hiroyuki <hidden>
Date: 2012-02-29 03:10:44
Also in: lkml

On Wed, 29 Feb 2012 03:02:46 +0100
Johannes Weiner [off-list ref] wrote:
On Wed, Feb 29, 2012 at 09:39:46AM +0900, KAMEZAWA Hiroyuki wrote:
quoted
On Tue, 28 Feb 2012 15:14:49 +0100
Johannes Weiner [off-list ref] wrote:
quoted
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -708,7 +708,8 @@ static enum page_references page_check_references(struct page *page,
 	int referenced_ptes, referenced_page;
 	unsigned long vm_flags;
 
-	referenced_ptes = page_referenced(page, 1, mz->mem_cgroup, &vm_flags);
+	referenced_ptes = page_referenced(page, 1, sc->target_mem_cgroup,
+					  &vm_flags);

I'm sorry if I don't understand the codes... !sc->target_mem_cgroup case is handled ?
Yes, but it's not obvious from the diff alone.  page_referenced() does
this:

		/*
		 * If we are reclaiming on behalf of a cgroup, skip
		 * counting on behalf of references from different
		 * cgroups
		 */
		if (memcg && !mm_match_cgroup(vma->vm_mm, memcg))
			continue;

As a result, !sc->target_mem_cgroup -- global reclaim -- will never
ignore references, or put differently, respect references from all
memcgs, which is what we want.
Ah, thank you. 

Acked-by: KAMEZAWA Hiroyuki <redacted>

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help