linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	yasu.isimatu@gmail.com, koki.sanagi@us.fujitsu.com
Subject: Re: [PATCH] mm, meminit: Serially initialise deferred memory if trace_buf_size is specified
Date: Wed, 15 Nov 2017 12:55:59 +0100	[thread overview]
Message-ID: <20171115115559.rjb5hy6d6332jgjj@dhcp22.suse.cz> (raw)
In-Reply-To: <20171115085556.fla7upm3nkydlflp@techsingularity.net>

On Wed 15-11-17 08:55:56, Mel Gorman wrote:
> Yasuaki Ishimatsu reported a premature OOM when trace_buf_size=100m was
> specified on a machine with many CPUs. The kernel tried to allocate 38.4GB
> but only 16GB was available due to deferred memory initialisation.
> 
> The allocation context is within smp_init() so there are no opportunities
> to do the deferred meminit earlier. Furthermore, the partial initialisation
> of memory occurs before the size of the trace buffers is set so there is
> no opportunity to adjust the amount of memory that is pre-initialised. We
> could potentially catch when memory is low during system boot and adjust the
> amount that is initialised serially but it's a little clumsy as it would
> require a check in the failure path of the page allocator.  Given that
> deferred meminit is basically a minor optimisation that only benefits very
> large machines and trace_buf_size is somewhat specialised, it follows that
> the most straight-forward option is to go back to serialised meminit if
> trace_buf_size is specified.

Can we instead do a smaller trace buffer in the early stage and then
allocate the rest after the whole memory is initialized? The early
memory init code is quite complex to make it even more so for something
that looks like a borderline useful usecase. Seriously, who is going
need 100M trace buffer _per cpu_ during early boot?

> Reported-and-tested-by: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
-- 
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-11-15 11:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15  8:55 Mel Gorman
2017-11-15 11:55 ` Michal Hocko [this message]
2017-11-15 14:13   ` Mel Gorman
2017-11-15 14:28     ` Michal Hocko
2017-11-15 14:43       ` Mel Gorman
2017-11-15 14:57         ` Michal Hocko
2017-11-15 19:17           ` YASUAKI ISHIMATSU
2017-11-16  8:54             ` Michal Hocko
2017-11-16 10:06               ` Mel Gorman
2017-11-17 18:19                 ` Pavel Tatashin
2017-11-17 21:32                   ` Mel Gorman
2017-11-30  3:41                     ` Pavel Tatashin
2017-12-06 10:50                       ` Mel Gorman
2018-01-31 17:28                         ` Koki.Sanagi
2018-01-31 18:24                           ` Pavel Tatashin
2018-02-05 14:14                             ` Masayoshi Mizuma
2018-02-05 15:26                               ` Pavel Tatashin
2017-11-21  1:04                   ` Andrew Morton
2017-11-30  3:49                     ` Pavel Tatashin
2017-11-15 19:49 ` Andrew Morton
2017-11-16  8:39   ` Mel Gorman

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=20171115115559.rjb5hy6d6332jgjj@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=koki.sanagi@us.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=yasu.isimatu@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