From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-mm <linux-mm@kvack.org>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [RFC][BUGFIX][PATCH] memcg: ensure list is empty at rmdir
Date: Tue, 12 Jan 2010 15:50:42 +0900 [thread overview]
Message-ID: <20100112155042.8a7a956d.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20100112145603.06dc2de0.kamezawa.hiroyu@jp.fujitsu.com>
On Tue, 12 Jan 2010 14:56:03 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > This patch tries to fix this bug by ensuring not only the usage is zero but also
> > all of the LRUs are empty. mem_cgroup_del_lru_list() checks the list is empty
> > or not, so we can make use of it.
> >
> Ah, ok. We call lru_add_drain() but doesn't check lru is really empty or not.
> It seems this patch can fix the problem.
> Thank you for great fix.
>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
Thank you for you ack.
> Following is nitpicks.
>
> > - }
> > - ret = 0;
> > + } while (mem->res.usage > 0 || ret);
>
> This seems unclear. (Not your mistake, maybe mine.)
>
I'll add a comment.
/* "ret" should also be checked to ensure all lists are empty. */
} while (mem->res.usage > 0 || ret);
> BTW, I think it's better to move drain_all_stock_sync(), too.
> as..
> ==
> do {
> ret = -EBUSY;
> if (cgroup_task_count(cgrp) || !list_empty(&cgrp->children))
> goto out;
> ret = -EINTR;
> if (signal_pending(current))
> goto out;
> /* This is for making all *used* pages to be on LRU. */
> lru_add_drain_all();
> ret = 0;
> for_each_node_state(node, N_HIGH_MEMORY) {
> ......
>
> cond_resched();
> /* Need to drain all cached "usage" befor we check counter */
> if (!ret)
> drain_all_stock_sync();
> if (ret == -EBUSY)
> cond_resched();
> } while (mem->res.usage != 0);
> ==
>
I agree.
We would be better not to drain stocks on failure path, but it's another topic :)
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:[~2010-01-12 6:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 5:08 Daisuke Nishimura
2010-01-12 5:56 ` KAMEZAWA Hiroyuki
2010-01-12 6:50 ` Daisuke Nishimura [this message]
2010-01-13 1:30 ` [BUGFIX][PATCH] " Daisuke Nishimura
2010-01-13 3:27 ` KAMEZAWA Hiroyuki
2010-01-13 5:27 ` Daisuke Nishimura
2010-01-13 5:35 ` 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=20100112155042.8a7a956d.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