linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Vijay Balakrishna <vijayb@linux.microsoft.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Oleg Nesterov <oleg@redhat.com>, Song Liu <songliubraving@fb.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Pavel Tatashin <pasha.tatashin@soleen.com>,
	Allen Pais <apais@microsoft.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [[PATCH]] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged
Date: Thu, 17 Sep 2020 14:12:13 +0200	[thread overview]
Message-ID: <20200917121213.GC29887@dhcp22.suse.cz> (raw)
In-Reply-To: <32b73685-48f2-b6dd-f000-8ea52cfee70a@linux.microsoft.com>

On Wed 16-09-20 11:28:40, Vijay Balakrishna wrote:
[...]
> OOM splat below.  I see we had kmem leak detection turned on here.  We
> haven't run stress with kmem leak detection since uncovereing low
> min_free_kbytes.  During investigation we wanted to make sure there is no
> kmem leaks, we didn't find significant leaks detected.
> 
> [330319.766059] systemd invoked oom-killer:
> gfp_mask=0x40cc0(GFP_KERNEL|__GFP_COMP), order=1, oom_score_adj=0

[...]
> [330319.861064] Mem-Info:
> [330319.863519] active_anon:60744 inactive_anon:109226 isolated_anon:0
>                  active_file:6418 inactive_file:3869 isolated_file:2
>                  unevictable:0 dirty:8 writeback:1 unstable:0
>                  slab_reclaimable:34660 slab_unreclaimable:795718
>                  mapped:1256 shmem:165765 pagetables:689 bounce:0
>                  free:340962 free_pcp:4672 free_cma:0

The memory consumption is predominantely in slab (unreclaimable). Only
~8% of the memory is on LRUs (anonymous + file). Slab (both reclaimable
and unreclaimable) is ~40%. So there is still a lot of memory
unaccounted (direct users of the page allocator). This would partially
explain why the oom killer is not able to make progress and eventually
panics because it is the kernel which is blowing the memory consumption.

There is still ~1G free memory but the problem is that this is a
GFP_KERNEL request which is not allowed to consume Movable memory.
Zone normal is depleted and therefore it cannot satisfy this request
even when there are some order-1 pages available.

> [330319.928124] Node 0 Normal free:12652kB min:14344kB low:19092kB=20
> high:23840kB active_anon:55340kB inactive_anon:60276kB active_file:60kB
> inactive_file:128kB unevictable:0kB writepending:4kB present:6220656kB
> managed:4750196kB mlocked:0kB kernel_stack:9568kB pagetables:2756kB
> bounce:0kB free_pcp:10056kB local_pcp:1376kB free_cma:0kB
[...]
> [330319.996879] Node 0 Normal: 3138*4kB (UME) 38*8kB (UM) 0*16kB 0*32kB
> 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 12856kB

I do not see the state of swap in the oom splat so I assume you have
swap disabled. If that is the case then the memory reclaim cannot really
do much for this request. There is almost no page cache to reclaim.

That being said I do not see how a increased min_free_kbytes could help
for this particular OOM situation. If there is really any relation it is
more of a unintended side effect.

[...]
> > > Extreme values can damage your system. Setting min_free_kbytes to an
> > > extremely low value prevents the system from reclaiming memory, which can
> > > result in system hangs and OOM-killing processes. However, setting
> > > min_free_kbytes too high (for example, to 5–10% of total system memory)
> > > causes the system to enter an out-of-memory state immediately, resulting in
> > > the system spending too much time reclaiming memory.
> > 
> > The auto tuned value should never reach such a low value to cause
> > problems.
> 
> The auto tuned value is incorrect post hotplug memory operation, in our use
> case memoy hot add occurs very early during boot.
 
Define incorrect. What are the actual values? Have you tried to increase
the value manually after the hotplug?

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2020-09-17 12:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 20:47 [[PATCH]] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged Vijay Balakrishna
2020-09-10 22:01 ` Kirill A. Shutemov
2020-09-10 22:28   ` Pavel Tatashin
2020-09-10 22:56     ` Vijay Balakrishna
2020-09-15  5:04   ` Vijay Balakrishna
2020-09-14 14:33 ` Michal Hocko
2020-09-14 16:57   ` Vijay Balakrishna
2020-09-15  8:18     ` Michal Hocko
2020-09-15 15:48       ` Vijay Balakrishna
2020-09-16  6:53         ` Michal Hocko
2020-09-16 18:28           ` Vijay Balakrishna
2020-09-17 12:12             ` Michal Hocko [this message]
2020-09-17 18:03               ` Vijay Balakrishna
2020-09-18  5:45                 ` Michal Hocko
2020-09-18 15:32                   ` Vijay Balakrishna
2020-09-21  7:00                     ` Michal Hocko
2020-09-15 18:22 ` Pavel Tatashin

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=20200917121213.GC29887@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=apais@microsoft.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=songliubraving@fb.com \
    --cc=vijayb@linux.microsoft.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;
as well as URLs for NNTP newsgroup(s).