OpenVZ Forum - RDF feed
type: channel
items: Re: [PATCH 03/10] memcg: Reclaim when more than one page needed.

Re: [PATCH 03/10] memcg: Reclaim when more than one page needed.
type: item
description: On Mon, 27 Feb 2012 14:58:46 -0800 Suleiman Souhlal <ssouhlal@FreeBSD.org> wrote: > From: Hugh Dickins <hughd@google.com> > > mem_cgroup_do_charge() was written before slab accounting, and expects > three cases: being called for 1 page, being called for a stock of 32 pages, > or being called for a hugepage. If we call for 2 pages (and several slabs > used in process creation are such, at least with the debug options I had), > it assumed it's being called for stock and just retried without reclaiming. > > Fix that by passing down a minsize argument in addition to the csize; > and pass minsize to consume_stock() also, so that it can draw on stock > for higher order slabs, instead of accumulating an increasing surplus > of stock, as its "nr_pages == 1" tests previously caused. > > And what to do about that (csize == PAGE_SIZE && ret) retry? If it's > needed at all (and presumably is since it's there, perhaps to handle > races), then it should be extended to more than PAGE_SIZE, yet how far? IIRC, this hack was added to avoid very-easy-oom-kill in a small memcg. If we can support dirty_ratio? and stop page reclaim to wait until writeback end, we can remove this, I think. > And should there be a retry count limit, of what? For now retry up to > COSTLY_ORDER (as page_alloc.c does), stay safe with a cond_resched(), > and make sure not to do it if __GFP_NORETRY. > Could you divide the changes to consume_stock() and mem_cgroup_do_charge() ? In these days, I personally don't like magical retry count.. Let's see what happens if we can wait I/O for memcg. We may not have to have any retry and be able to clean up this loop. Thanks, -Kame > Signed-off-by: Hugh Dickins <hughd@google.com> > Signed-off-by: Suleiman Souhlal <suleiman@google.com> > --- > mm/memcontrol.c | 35 +++++++++++++++++++---------------- > 1 files changed, 19 insertions(+), 16 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 6f44fcb..c82ca1c 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcon…
creator: KAMEZAWA Hiroyuki
date: 2012-02-29T06:18:52-00:00