From: "KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Hugh Dickins <hugh@veritas.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andi Kleen <andi@firstfloor.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 2/2] memcg: add accessor to mem_cgroup.css
Date: Sat, 12 Sep 2009 09:51:01 +0900 (JST) [thread overview]
Message-ID: <7c7a5bbcd7ad21ea1cee1b6df3a28494.squirrel@webmail-b.css.fujitsu.com> (raw)
In-Reply-To: <20090911112259.GA20988@localhost>
Wu Fengguang wrote:
> So that an outside user can free the reference count grabbed by
> try_get_mem_cgroup_from_page().
>
While no heavy caller for this, I(we) would like to hide mem_cgroup
under memcontrol.c
Personally, I like no #ifdef for this easy code ;)
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Hugh Dickins <hugh@veritas.com>
> CC: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> CC: Balbir Singh <balbir@linux.vnet.ibm.com>
> CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
> include/linux/memcontrol.h | 7 +++++++
> mm/memcontrol.c | 8 ++++++++
> 2 files changed, 15 insertions(+)
>
> --- linux-mm.orig/include/linux/memcontrol.h 2009-09-11 18:16:55.000000000
> +0800
> +++ linux-mm/include/linux/memcontrol.h 2009-09-11 18:16:56.000000000
> +0800
> @@ -81,6 +81,8 @@ int mm_match_cgroup(const struct mm_stru
> return cgroup == mem;
> }
>
> +extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup
> *mem);
> +
> extern int
> mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr);
> extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
> @@ -206,6 +208,11 @@ static inline int task_in_mem_cgroup(str
> return 1;
> }
>
> +static inline struct cgroup_subsys_state *mem_cgroup_css(struct
> mem_cgroup *mem)
> +{
> + return NULL;
> +}
> +
> static inline int
> mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr)
> {
> --- linux-mm.orig/mm/memcontrol.c 2009-09-11 18:16:55.000000000 +0800
> +++ linux-mm/mm/memcontrol.c 2009-09-11 18:18:11.000000000 +0800
> @@ -282,6 +282,14 @@ mem_cgroup_zoneinfo(struct mem_cgroup *m
> return &mem->info.nodeinfo[nid]->zoneinfo[zid];
> }
>
> +#ifdef CONFIG_HWPOISON_INJECT /* for now, only user is hwpoison injector
> */
> +struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
> +{
> + return &mem->css;
> +}
> +EXPORT_SYMBOL(mem_cgroup_css);
> +#endif
> +
> static struct mem_cgroup_per_zone *
> page_cgroup_zoneinfo(struct page_cgroup *pc)
> {
>
--
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:[~2009-09-12 2:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 11:22 [PATCH 1/2] memcg: rename and export try_get_mem_cgroup_from_page() Wu Fengguang
2009-09-11 11:22 ` [PATCH 2/2] memcg: add accessor to mem_cgroup.css Wu Fengguang
2009-09-12 0:51 ` KAMEZAWA Hiroyuki [this message]
2009-09-11 11:36 ` [PATCH 1/2] memcg: rename and export try_get_mem_cgroup_from_page() Wu Fengguang
2009-09-12 0:47 ` KAMEZAWA Hiroyuki
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=7c7a5bbcd7ad21ea1cee1b6df3a28494.squirrel@webmail-b.css.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=fengguang.wu@intel.com \
--cc=hugh@veritas.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
/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