Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1245166

Re: Silent hang up caused by pages being not scanned?

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: Silent hang up caused by pages being not scanned?
Date 2015-10-12 23:30 +0200
Message-ID <qiSPr-2Lm-71@gated-at.bofh.it> (permalink)
References (1 earlier) <qf7N0-3r7-13@gated-at.bofh.it> <qfob7-1Mk-5@gated-at.bofh.it> <qgBSH-PD-19@gated-at.bofh.it> <qiF5M-7Ss-5@gated-at.bofh.it> <qiNd0-2Xu-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Oct 12, 2015 at 8:25 AM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> I examined this hang up using additional debug printk() patch. And it was
> observed that when this silent hang up occurs, zone_reclaimable() called from
> shrink_zones() called from a __GFP_FS memory allocation request is returning
> true forever. Since the __GFP_FS memory allocation request can never call
> out_of_memory() due to did_some_progree > 0, the system will silently hang up
> with 100% CPU usage.

I wouldn't blame the zones_reclaimable() logic itself, but yeah, that looks bad.

So the do_try_to_free_pages() logic that does that

        /* Any of the zones still reclaimable?  Don't OOM. */
        if (zones_reclaimable)
                return 1;

is rather dubious. The history of that odd line is pretty dubious too:
it used to be that we would return success if "shrink_zones()"
succeeded or if "nr_reclaimed" was non-zero, but that "shrink_zones()"
logic got rewritten, and I don't think the current situation is all
that sane.

And returning 1 there is actively misleading to callers, since it
makes them think that it made progress.

So I think you should look at what happens if you just remove that
illogical and misleading return value.

HOWEVER.

I think that it's very true that we have then tuned all our *other*
heuristics for taking this thing into account, so I suspect that we'll
find that we'll need to tweak other places. But this crazy "let's say
that we made progress even when we didn't" thing looks just wrong.

In particular, I think that you'll find that you will have to change
the heuristics in __alloc_pages_slowpath() where we currently do

        if ((did_some_progress && order <= PAGE_ALLOC_COSTLY_ORDER) || ..

when the "did_some_progress" logic changes that radically.

Because while the current return value looks insane, all the other
testing and tweaking has been done with that very odd return value in
place.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Can't we use timeout based OOM warning/killing? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-06 17:00 +0200
  Re: Can't we use timeout based OOM warning/killing? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-12 08:50 +0200
    Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-12 17:30 +0200
      Re: Silent hang up caused by pages being not scanned? Linus Torvalds <torvalds@linux-foundation.org> - 2015-10-12 23:30 +0200
        Re: Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-13 14:30 +0200
          Re: Silent hang up caused by pages being not scanned? Linus Torvalds <torvalds@linux-foundation.org> - 2015-10-13 18:40 +0200
            Re: Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-14 14:30 +0200
            Re: Silent hang up caused by pages being not scanned? Michal Hocko <mhocko@kernel.org> - 2015-10-15 15:20 +0200
              Re: Silent hang up caused by pages being not scanned? Michal Hocko <mhocko@kernel.org> - 2015-10-16 18:00 +0200
                Re: Silent hang up caused by pages being not scanned? Linus Torvalds <torvalds@linux-foundation.org> - 2015-10-16 20:40 +0200
                Re: Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-16 20:50 +0200
      Re: Silent hang up caused by pages being not scanned? Michal Hocko <mhocko@kernel.org> - 2015-10-13 15:40 +0200
        Re: Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-13 18:20 +0200
          Re: Silent hang up caused by pages being not scanned? Michal Hocko <mhocko@kernel.org> - 2015-10-14 15:30 +0200
            Re: Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-14 16:40 +0200
              Re: Silent hang up caused by pages being not scanned? Michal Hocko <mhocko@kernel.org> - 2015-10-14 17:00 +0200
                Re: Silent hang up caused by pages being not scanned? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-14 17:10 +0200

csiph-web