From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: nishimura@mxp.nes.nec.co.jp,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>
Subject: Re: [RFC][PATCH 10/10] memcg: add commentary
Date: Wed, 30 Sep 2009 11:21:49 +0900 [thread overview]
Message-ID: <20090930112149.87bc16fe.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20090925173018.2435084f.kamezawa.hiroyu@jp.fujitsu.com>
A few trivial comments and a question.
> @@ -1144,6 +1172,13 @@ static int mem_cgroup_count_children(str
> mem_cgroup_walk_tree(mem, &num, mem_cgroup_count_children_cb);
> return num;
> }
> +
> +/**
> + * mem_cgroup_oon_called - check oom-kill is called recentlry under memcg
s/oon/oom/
> + * @mem: mem_cgroup to be checked.
> + *
> + * Returns true if oom-kill was invoked in this memcg recently.
> + */
> bool mem_cgroup_oom_called(struct task_struct *task)
> {
> bool ret = false;
> @@ -1314,6 +1349,16 @@ static int mem_cgroup_hierarchical_recla
> return total;
> }
>
> +/*
> + * This function is called by kswapd before entering per-zone memory reclaim.
> + * This selects a victim mem_cgroup from soft-limit tree and memory will be
> + * reclaimed from that.
> + *
> + * Soft-limit tree is sorted by the extent how many mem_cgroup's memoyr usage
> + * excess the soft limit and a memory cgroup which has the largest excess
> + * s selected as a victim. This Soft-limit tree is maintained perzone and
"is selected"
^
> + * we never select a memcg which has no memory usage on this zone.
> + */
I'm sorry if I misunderstand about softlimit implementation, what prevents
a memcg which has no memory usage on this zone from being selected ?
IIUC, mz->usage_in_excess has a value calculated from res_counter_soft_limit_excess(),
which doesn't take account of zone but only calculates "usage - soft_limit".
> unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
> gfp_t gfp_mask, int nid,
> int zid)
> @@ -1757,6 +1819,11 @@ __mem_cgroup_commit_charge_swapin(struct
> return;
> cgroup_exclude_rmdir(&ptr->css);
> pc = lookup_page_cgroup(page);
> + /*
> + * We may overwrite pc->memcgoup in commit_charge(). But SwapCache
should be "pc->mem_cgroup".
> + * can be on LRU before we reach here. Remove it from LRU for avoiding
> + * confliction.
> + */
> mem_cgroup_lru_del_before_commit_swapcache(page);
> __mem_cgroup_commit_charge(ptr, pc, ctype);
> mem_cgroup_lru_add_after_commit_swapcache(page);
>
Thanks,
Daisuke Nishimura.
--
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-30 2:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 8:17 [RFC][PATCH 0/10] memcg clean up and some fixes for softlimit (Sep25) KAMEZAWA Hiroyuki
2009-09-25 8:18 ` [RFC][PATCH 1/10] memcg : modifications for softlimit uncharge KAMEZAWA Hiroyuki
2009-09-25 8:20 ` [RFC][PATCH 2/10] memcg : clean up in softlimit charge KAMEZAWA Hiroyuki
2009-09-25 8:21 ` [RFC][PATCH 3/10] memcg: reorganize memcontrol.c KAMEZAWA Hiroyuki
2009-09-25 8:22 ` [RFC][PATCH 4/10] memcg: add memcg charge cancel KAMEZAWA Hiroyuki
2009-09-25 8:24 ` [RFC][PATCH 5/10] memcg: clean up percpu statistics access KAMEZAWA Hiroyuki
2009-09-25 8:25 ` [RFC][PATCH 6/10] memcg: remove unsued macros KAMEZAWA Hiroyuki
2009-09-25 8:25 ` [RFC][PATCH 0/10] memcg clean up and some fixes for softlimit (Sep25) Balbir Singh
2009-09-25 8:27 ` [RFC][PATCH 7/10] memcg: replace cont with cgroup KAMEZAWA Hiroyuki
2009-09-25 8:28 ` [RFC][PATCH 8/10] memcg: clean up charge/uncharge anon KAMEZAWA Hiroyuki
2009-09-29 0:24 ` Daisuke Nishimura
2009-09-29 1:26 ` KAMEZAWA Hiroyuki
2009-09-29 2:18 ` Daisuke Nishimura
2009-09-29 3:03 ` Daisuke Nishimura
2009-09-29 3:14 ` KAMEZAWA Hiroyuki
2009-09-25 8:29 ` [RFC][PATCH 9/10] memcg: clean up perzone stat KAMEZAWA Hiroyuki
2009-09-25 8:30 ` [RFC][PATCH 10/10] memcg: add commentary KAMEZAWA Hiroyuki
2009-09-30 2:21 ` Daisuke Nishimura [this message]
2009-09-30 2:41 ` KAMEZAWA Hiroyuki
2009-09-30 4:36 ` Daisuke Nishimura
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=20090930112149.87bc16fe.nishimura@mxp.nes.nec.co.jp \
--to=nishimura@mxp.nes.nec.co.jp \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.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