lkml.org 
[lkml]   [2012]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 31/31] sched, numa, mm: Add memcg support to do_huge_pmd_numa_page()
From: Johannes Weiner <hannes@cmpxchg.org>

[ Turned email suggestions into patch plus fixes. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
mm/huge_memory.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Index: tip/mm/huge_memory.c
===================================================================
--- tip.orig/mm/huge_memory.c
+++ tip/mm/huge_memory.c
@@ -742,6 +742,7 @@ void do_huge_pmd_numa_page(struct mm_str
unsigned int flags, pmd_t entry)
{
unsigned long haddr = address & HPAGE_PMD_MASK;
+ struct mem_cgroup *memcg = NULL;
struct page *new_page = NULL;
struct page *page = NULL;
int node, lru;
@@ -800,6 +801,8 @@ migrate:
if (!new_page)
goto alloc_fail;

+ mem_cgroup_prepare_migration(page, new_page, &memcg);
+
lru = PageLRU(page);

if (lru && isolate_lru_page(page)) /* does an implicit get_page() */
@@ -852,14 +855,19 @@ migrate:
put_page(page); /* drop the LRU isolation reference */

unlock_page(new_page);
+
+ mem_cgroup_end_migration(memcg, page, new_page, true);
+
unlock_page(page);
put_page(page); /* Drop the local reference */

return;

alloc_fail:
- if (new_page)
+ if (new_page) {
+ mem_cgroup_end_migration(memcg, page, new_page, false);
put_page(new_page);
+ }

unlock_page(page);




\
 
 \ /
  Last update: 2012-10-25 16:01    [W:0.162 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site