From: Pavel Tatashin <pasha.tatashin@oracle.com>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@kernel.org>,
YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org, koki.sanagi@us.fujitsu.com,
Steve Sistare <steven.sistare@oracle.com>
Subject: Re: [PATCH] mm, meminit: Serially initialise deferred memory if trace_buf_size is specified
Date: Fri, 17 Nov 2017 13:19:56 -0500 [thread overview]
Message-ID: <CAOAebxt8ZjfCXND=1=UJQETbjVUGPJVcqKFuwGsrwyM2Mq1dhQ@mail.gmail.com> (raw)
In-Reply-To: <20171116100633.moui6zu33ctzpjsf@techsingularity.net>
On Thu, Nov 16, 2017 at 5:06 AM, Mel Gorman <mgorman@techsingularity.net> wrote:
> 4. Put a check into the page allocator slowpath that triggers serialised
> init if the system is booting and an allocation is about to fail. It
> would be such a cold path that it would never be noticable although it
> would leave dead code in the kernel image once boot had completed
Hi Mel,
The forth approach is the best as it is seamless for admins and
engineers, it will also work on any system configuration with any
parameters without any special involvement.
This approach will also address the following problem:
reset_deferred_meminit() has some assumptions about how much memory we
will need beforehand may break periodically as kernel requirements
change. For, instance, I recently reduced amount of memory system hash
tables take on large machines [1], so the comment in that function is
already outdated:
/*
* Initialise at least 2G of a node but also take into account that
* two large system hashes that can take up 1GB for 0.25TB/node.
*/
With this approach we could always init a very small amount of struct
pages, and allow the rest to be initialized on demand as boot requires
until deferred struct pages are initialized. Since, having deferred
pages feature assumes that the machine is large, there is no drawback
of having some extra byte of dead code, especially that all the checks
can be permanently switched of via static branches once deferred init
is complete.
The second benefit that this approach may bring is the following: it
may enable to add a new feature which would initialize struct pages on
demand later, when needed by applications. This feature would be
configurable or enabled via kernel parameter (not sure which is
better).
if (allocation is failing)
if (uninit struct pages available)
init enought to finish alloc
Again, once all pages are initialized, the checks will be turned off
via static branching, so I think the code can be shared.
Here is the rationale for this feature:
Each physical machine may run a very large number of linux containers.
Steve Sistare (CCed), recently studied how much memory each instance
of clear container is taking, and it turns out to be about 125 MB,
when containers are booted with 2G of memory and 1 CPU. Out of those
125 MB, 32 MB is consumed by struct page array as we use 64-bytes per
page. Admins tend to be protective in the amount of memory that is
configured, therefore they may over-commit the amount of memory that
is actually required by the container. So, by allowing struct pages to
be initialized only on demand, we can save around 25% of the memory
that is consumed by fresh instance of container. Now, that struct
pages are not zeroed during boot [2], and if we will implement the
forth option, we can get closer to implementing a complete on demand
struct page initialization.
I can volunteer to work on these projects.
[1] https://patchwork.kernel.org/patch/9599545/
[2] https://lwn.net/Articles/734374
Thank you,
Pavel
--
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>
next prev parent reply other threads:[~2017-11-17 18:20 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
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 [this message]
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='CAOAebxt8ZjfCXND=1=UJQETbjVUGPJVcqKFuwGsrwyM2Mq1dhQ@mail.gmail.com' \
--to=pasha.tatashin@oracle.com \
--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=mhocko@kernel.org \
--cc=steven.sistare@oracle.com \
--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