Re: Deadlock possibly caused by too_many_isolated.

From: Wu Fengguang
Date: Mon Oct 18 2010 - 23:05:29 EST


On Tue, Oct 19, 2010 at 10:52:47AM +0800, Minchan Kim wrote:
> Hi Wu,
>
> On Tue, Oct 19, 2010 at 11:35 AM, Wu Fengguang <fengguang.wu@xxxxxxxxx> wrote:
> >> @@ -2054,10 +2069,11 @@ rebalance:
> >> Â Â Â Â Â Â Â Â goto got_pg;
> >>
> >> Â Â Â Â /*
> >> - Â Â Â Â* If we failed to make any progress reclaiming, then we are
> >> - Â Â Â Â* running out of options and have to consider going OOM
> >> + Â Â Â Â* If we failed to make any progress reclaiming and there aren't
> >> + Â Â Â Â* many parallel reclaiming, then we are unning out of options and
> >> + Â Â Â Â* have to consider going OOM
> >> Â Â Â Â Â*/
> >> - Â Â Â if (!did_some_progress) {
> >> + Â Â Â if (!did_some_progress && !too_many_isolated_zone(preferred_zone)) {
> >> Â Â Â Â Â Â Â Â if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY)) {
> >> Â Â Â Â Â Â Â Â Â Â Â Â if (oom_killer_disabled)
> >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â goto nopage;
> >
> > This is simply wrong.
> >
> > It disabled this block for 99% system because there won't be enough
> > tasks to make (!too_many_isolated_zone == true). As a result the LRU
> > will be scanned like mad and no task get OOMed when it should be.
>
> If !too_many_isolated_zone is false, it means there are already many
> direct reclaiming tasks.
> So they could exit reclaim path and !too_many_isolated_zone will be true.
> What am I missing now?

Ah sorry, my brain get short circuited.. but I still feel uneasy with
this change. It's not fixing the root cause and won't prevent too many
LRU pages be isolated. It's too late to test too_many_isolated_zone()
after direct reclaim returns (after sleeping for a long time).

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/