Re: Deferred Memory Init: How to bring rest of memory online after limiting it with `mem=XG`?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux