linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: David Hildenbrand <david@redhat.com>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
	linux-mm@kvack.org, Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: Deferred Memory Init: How to bring rest of memory online after limiting it with `mem=XG`?
Date: Fri, 4 Dec 2020 09:17:58 +0800	[thread overview]
Message-ID: <20201204011758.GA29328@shbuild999.sh.intel.com> (raw)
In-Reply-To: <808e493f-18a2-fe82-46b3-e44fe87e989c@redhat.com>

Hi David,

On Thu, Dec 03, 2020 at 01:25:04PM +0100, David Hildenbrand wrote:
> On 03.12.20 11:51, Paul Menzel wrote:
> > Dear Feng,
> > 
> > 
> > I am trying to reduce the startup time of Debian’s Linux 5.9.9 on a 
> > Intel Kaby Lake system with 32 GB of memory (TUXEDO Book BU1406 (Clevo 
> > N240BU)). On your Linux Plumbers Conference 2019 slides of your talk 
> > *Linux Kernel Fastboot On the Way* [1], you mention *Deferred Memory Init*:
> > 
> >> Deferred Memory Init
> >>
> >> •   8GB RAM’s initialization costs 100+ ms
> >> •   In early boot phase, we don’t need that much memory
> >> •   Utilize the memory hotplug feature
> >>     •   “mem=4096m” in cmdline to only init 2 GB
> >>     •   Use systemd service to add rest memory in parallel
> 
> Uh, that sounds very wrong and flawed.
> 
> Even if you would be adding+onlining memory in parallel, memory
> hotplug/onlining code runs strictly sequential. This does not work.
> 
> And I question this approach in general.
> 
> We do have deferred meminit in the kernel during boot that can
> initialize memory in parallel.

Yes, this is what can now use decently.

The foil was written in 2019 and the work is done in 2018 with kernel
4.9~4.19 kernel, where this feature was not availabe.

Interestingly, I called for the in-kernel deferred init in LPC, and in
the LPC room, Pavel Tatashin told me that they were working on it, and
it's great to see it is completed, which is really useful for optimizing
kernel boot time.

btw, the user space task to online the other memory was actually some
script, like

for i in x..y
do
	echo online > /sys/devices/system/memory$i/state
done

Thanks,
Feng

> 
> -- 
> Thanks,
> 
> David / dhildenb


  parent reply	other threads:[~2020-12-04  1:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 10:51 Paul Menzel
2020-12-03 12:25 ` David Hildenbrand
2020-12-03 12:52   ` Paul Menzel
2020-12-03 13:06     ` David Hildenbrand
2020-12-03 20:58       ` Daniel Jordan
2020-12-04  7:31         ` Paul Menzel
2020-12-04 19:50           ` Daniel Jordan
2020-12-04  1:17   ` Feng Tang [this message]
2020-12-04  8:05 ` Feng Tang

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=20201204011758.GA29328@shbuild999.sh.intel.com \
    --to=feng.tang@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=pmenzel@molgen.mpg.de \
    /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