Re: [PATCH -mm] memcg: fix handling of shmem migration

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daisuke Nishimura
Date: Tuesday, September 16, 2008 - 11:19 pm

On Wed, 17 Sep 2008 14:50:03 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

Hmm, something like this?

---
@@ -734,6 +734,9 @@ int mem_cgroup_prepare_migration(struct page *page, struct page *newpa
        if (mem_cgroup_subsys.disabled)
                return 0;

+       if (PageSwapBacked(page))
+               SetPageSwapBacked(newpage);
+
        lock_page_cgroup(page);
        pc = page_get_page_cgroup(page);
        if (pc) {
---

Or, adding MEM_CGROUP_CHARGE_TYPE_SHMEM and

---
@@ -740,7 +740,10 @@ int mem_cgroup_prepare_migration(struct page *page, struct page *newp
                mem = pc->mem_cgroup;
                css_get(&mem->css);
                if (pc->flags & PAGE_CGROUP_FLAG_CACHE)
-                       ctype = MEM_CGROUP_CHARGE_TYPE_CACHE;
+                       if (page_is_file_cache(page))
+                               ctype = MEM_CGROUP_CHARGE_TYPE_CACHE;
+                       else
+                               ctype = MEM_CGROUP_CHARGE_TYPE_SHMEM;
        }
        unlock_page_cgroup(page);
        if (mem) {
---
(Of course, mem_cgroup_charge_common should be modified too.)


Thanks,
Daisuke Nishimura.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -mm] memcg: fix handling of shmem migration, Daisuke Nishimura, (Tue Sep 16, 9:31 pm)
Re: [PATCH -mm] memcg: fix handling of shmem migration, KAMEZAWA Hiroyuki, (Tue Sep 16, 10:46 pm)
Re: [PATCH -mm] memcg: fix handling of shmem migration, KAMEZAWA Hiroyuki, (Tue Sep 16, 10:50 pm)
Re: [PATCH -mm] memcg: fix handling of shmem migration, Daisuke Nishimura, (Tue Sep 16, 11:19 pm)
Re: [PATCH -mm] memcg: fix handling of shmem migration, KAMEZAWA Hiroyuki, (Tue Sep 16, 11:38 pm)
Re: [PATCH -mm] memcg: fix handling of shmem migration, Daisuke Nishimura, (Tue Sep 16, 11:45 pm)
[PATCH -mm] memcg: fix handling of shmem migration(v2), Daisuke Nishimura, (Wed Sep 17, 12:55 am)
Re: [PATCH -mm] memcg: fix handling of shmem migration(v2), KAMEZAWA Hiroyuki, (Wed Sep 17, 2:18 am)
Re: [PATCH -mm] memcg: fix handling of shmem migration(v2), Daisuke Nishimura, (Wed Sep 17, 7:03 pm)
Re: [PATCH -mm] memcg: fix handling of shmem migration(v2), KAMEZAWA Hiroyuki, (Wed Sep 17, 7:38 pm)