From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, balbir@linux.vnet.ibm.com,
xemul@openvz.org
Subject: Re: [PATCH -mm] memcg: fix handling of shmem migration
Date: Wed, 17 Sep 2008 15:38:26 +0900 [thread overview]
Message-ID: <20080917153826.8efbdc4b.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20080917151951.9a181e7d.nishimura@mxp.nes.nec.co.jp>
On Wed, 17 Sep 2008 15:19:51 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> 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.)
>
like this :) I don't want to change logic in migration.c
(and this is special case handling for memcg.)
Thanks,
-Kame
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-09-17 6:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-17 4:31 Daisuke Nishimura
2008-09-17 5:46 ` KAMEZAWA Hiroyuki
2008-09-17 5:50 ` KAMEZAWA Hiroyuki
2008-09-17 6:19 ` Daisuke Nishimura
2008-09-17 6:38 ` KAMEZAWA Hiroyuki [this message]
2008-09-17 6:45 ` Daisuke Nishimura
2008-09-17 7:55 ` [PATCH -mm] memcg: fix handling of shmem migration(v2) Daisuke Nishimura
2008-09-17 9:18 ` KAMEZAWA Hiroyuki
2008-09-17 22:51 ` Andrew Morton
2008-09-18 2:03 ` Daisuke Nishimura
2008-09-18 2:38 ` KAMEZAWA Hiroyuki
2008-09-18 5:43 ` Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080917153826.8efbdc4b.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox