linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: "Михаил Гаврилов" <mikhail.v.gavrilov@gmail.com>
Cc: "Du, Changbin" <changbin.du@intel.com>, linux-mm@kvack.org
Subject: Re: swapper/0: page allocation failure: order:0, mode:0x1204010(GFP_NOWAIT|__GFP_COMP|__GFP_RECLAIMABLE|__GFP_NOTRACK), nodemask=(null)
Date: Tue, 24 Oct 2017 22:06:39 +0200	[thread overview]
Message-ID: <20171024200639.2pyxkw2cucwxrtlb@dhcp22.suse.cz> (raw)
In-Reply-To: <CABXGCsMZ0hFFJyPU2cu+JDLHZ+5eO5i=8FOv71biwpY5neyofA@mail.gmail.com>

On Wed 25-10-17 00:30:18, D?D,N?D?D,D>> D?D?D2N?D,D>>D 3/4 D2 wrote:
> On 20 October 2017 at 14:12, Michal Hocko <mhocko@kernel.org> wrote:
> > On Fri 20-10-17 14:43:06, Du, Changbin wrote:
> >> On Thu, Oct 19, 2017 at 11:52:49PM +0500, D?D,N?D?D,D>> D?D?D2N?D,D>>D 3/4 D2 wrote:
> >> > On 19 October 2017 at 08:56, Du, Changbin <changbin.du@intel.com> wrote:
> >> > > On Thu, Oct 19, 2017 at 01:16:48AM +0500, D?D,N?D?D,D>> D?D?D2N?D,D>>D 3/4 D2 wrote:
> >> > > I am curious about this, how can slub try to alloc compound page but the order
> >> > > is 0? This is wrong.
> >> >
> >> > Nobody seems to know how this could happen. Can any logs shed light on this?
> >> >
> >> After checking the code, kernel can handle such case. So please ignore my last
> >> comment.
> >>
> >> The warning is reporting OOM, first you need confirm if you have enough free
> >> memory? If that is true, then it is not a programmer error.
> >
> > The kernel is not OOM. It just failed to allocate for GFP_NOWAIT which
> > means that no memory reclaim could be used to free up potentially unused
> > page cache. This means that kswapd is not able to free up memory in the
> > pace it is allocated. Such an allocation failure shouldn't be critical
> > and the caller should have means to fall back to a regular allocation or
> > retry later. You can play with min_free_kbytes and increase it to kick
> > the background reclaim sooner.
> 
> Michal, thanks for clarification.
> It means if any application allocate for GFP_NOWAIT and we not having
> enough free memory (RAM) we will got this warning.
> For example:
> $ free -ht
>               total        used        free      shared  buff/cache   available
> Mem:            30G         27G        277M        1,6G        2,8G        593M
> Swap:           59G         21G         38G
> Total:          89G         48G         38G
> I see that computer have total free 38G, but only 277M available free RAM.
> So if we try allocate now more than 277M we get this warning again, right?

Well, not really. As soon as we hit a so called low watermark the
background reclaim (kswapd) kicks in and that will try to free up some
of the reclaimable memory. Allocations are still allowed to go on. It is
only when we hit min watermark when the allocation has to perform the
memory reclaim in the allocation context (so called direct reclaim).
GFP_NOWAIT request cannot sleep and as such they cannot perform the
direct reclaim and have to fail. So this thing usually happens when the
allocation pace is larger than the background reclaim can free up in the
background.
 
> I try reproduce it with kernel 4.13.8, but get another warning:
> 
> [ 3551.169126] chrome: page allocation stalls for 11542ms, order:0,
> mode:0x14280ca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), nodemask=(null)

this is a sleeping allocation which means that it is allowed to perform
the direct reclaim and that took a lot of time here. This is really
unusual and worth debugging some more.

[...]
> [ 3551.169590] Mem-Info:
> [ 3551.169595] active_anon:6904352 inactive_anon:520427 isolated_anon:0
>                 active_file:55480 inactive_file:38890 isolated_file:0
>                 unevictable:1836 dirty:556 writeback:0 unstable:0
>                 slab_reclaimable:67559 slab_unreclaimable:95967
>                 mapped:353547 shmem:480723 pagetables:89161 bounce:0
>                 free:49404 free_pcp:1474 free_cma:0

This tells us that there is quite some page cache (file LRUs) to reclaim
so I am wondering what could have caused such a delay. In order to debug
this some more we would need an additional debugging information. I
usually enable vmscan tracepoints to watch for events during the
reclaim.

[...]
> it's same problem?

so no, this looks like a separate issue.
-- 
Michal Hocko
SUSE Labs

--
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>

  reply	other threads:[~2017-10-24 20:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 20:16 Михаил Гаврилов
2017-10-19  3:56 ` Du, Changbin
2017-10-19 18:52   ` Михаил Гаврилов
2017-10-20  6:43     ` Du, Changbin
2017-10-20  9:12       ` Michal Hocko
2017-10-24 19:30         ` Михаил Гаврилов
2017-10-24 20:06           ` Michal Hocko [this message]
2017-10-26 17:49             ` Михаил Гаврилов
2017-10-29 21:48               ` Михаил Гаврилов
2017-11-02 13:15                 ` Tetsuo Handa
2017-11-02 15:01                   ` Michal Hocko
2017-11-02 15:06                     ` Michal Hocko
2017-11-06 20:48                       ` Михаил Гаврилов

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=20171024200639.2pyxkw2cucwxrtlb@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=changbin.du@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mikhail.v.gavrilov@gmail.com \
    /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