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: Mon, 21 Sep 2020 09:00:06 +0200	[thread overview]
Message-ID: <20200921070006.GA12990@dhcp22.suse.cz> (raw)
In-Reply-To: <2bd9ebf5-f6b7-1a2a-be61-9d4af8210cce@linux.microsoft.com>

On Fri 18-09-20 08:32:13, Vijay Balakrishna wrote:
> 
> 
> On 9/17/2020 10:45 PM, Michal Hocko wrote:
> > On Thu 17-09-20 11:03:56, Vijay Balakrishna wrote:
> > [...]
> > > > > 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?
> > > 
> > > In our case SoC with 8GB memory, system tuned min_free_kbytes
> > > - first to 22528
> > > - we perform memory hot add very early in boot
> > 
> > What was the original and after-the-hotplug size of memory and layout?
> > I suspect that all the hotplugged memory is in Movable zone, right?
> 
> Yes, added ~1.92GB as Movable type, booting with 6GB at start.
> 
> > 
> > > - now min_free_kbytes is 8703
> > > 
> > > Before looking at code, first I manually restored min_free_kbytes soon after
> > > boot, reran stress and didn't notice symptoms I mentioned in change log.
> > 
> > This is really surprising and I strongly suspect that an earlier reclaim
> > just changed the timing enough so that workload has spread the memory
> > prpessure over a longer time and that might have been enough to recycle
> > some of the unreclaimable memory due to its natural life time. But this
> > is a pure speculation. Much more data would be needed to analyze this.
> > 
> > In any case your stress test is oveprovisioning your Normal zone and
> > increased min_free_kbytes just papers over the sizing problem.
> > 
> 
> It is a synthetic workload, likely not sized I need to check.  I feel having
> higher min_free_kbytes made GFP_ATOMIC allocations not to fail.

Yes a higher min_free_kbytes will help GFP_ATOMIC. But only to some
degree. But nobody should depend on an atomic allocation for
correctness. It is just way too easy to fail under a higher memory
pressure.

> I have seen
> NETDEV WATCHDOG timeout with stacktrace trying to allocate memory, looping
> in net rx receive path.

You should talk to net folks.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2020-09-21  7:00 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
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 [this message]
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=20200921070006.GA12990@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).