linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, corbet@lwn.net,
	catalin.marinas@arm.com, will@kernel.org,
	linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [v1 0/5] allow to reserve memory for normal kexec kernel
Date: Mon, 08 Jul 2019 18:53:41 -0500	[thread overview]
Message-ID: <87sgrgjd6i.fsf@xmission.com> (raw)
In-Reply-To: <20190708211528.12392-1-pasha.tatashin@soleen.com> (Pavel Tatashin's message of "Mon, 8 Jul 2019 17:15:23 -0400")

Pavel Tatashin <pasha.tatashin@soleen.com> writes:

> Currently, it is only allowed to reserve memory for crash kernel, because
> it is a requirement in order to be able to boot into crash kernel without
> touching memory of crashed kernel is to have memory reserved.
>
> The second benefit for having memory reserved for kexec kernel is
> that it does not require a relocation after segments are loaded into
> memory.
>
> If kexec functionality is used for a fast system update, with a minimal
> downtime, the relocation of kernel + initramfs might take a significant
> portion of reboot.
>
> In fact, on the machine that we are using, that has ARM64 processor
> it takes 0.35s to relocate during kexec, thus taking 52% of kernel reboot
> time:
>
> kernel shutdown	0.03s
> relocation	0.35s
> kernel startup	0.29s
>
> Image: 13M and initramfs is 24M. If initramfs increases, the relocation
> time increases proportionally.

Something is very very wrong there.

Last I measured memory bandwidth seriously I could touch a Gigabyte per
second easily, and that was nearly 20 years ago.  Did you manage to
disable caching or have some particularly slow code that does the
reolocations.

There is a serious cost to reserving memory in that it is simply not
available at other times.  For kexec on panic there is no other reliable
way to get memory that won't be DMA'd to.

We have options in this case and I would strongly encourage you to track
down why that copy in relocation is so very slow.  I suspect a 4KiB page
size is large enough that it can swamp pointer following costs.

My back of the napkin math says even 20 years ago your copying costs
should be only 0.037s.  The only machine I have ever tested on where
the copy costs were noticable was my old 386.

Maybe I am out to lunch here but a claim that your memory only runs
at 100MiB/s (the speed of my spinning rust hard drive) is rather
incredible.

Eric

  parent reply	other threads:[~2019-07-08 23:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 21:15 [v1 0/5] allow to reserve memory for normal kexec kernel Pavel Tatashin
2019-07-08 21:15 ` [v1 1/5] kexec: quiet down kexec reboot Pavel Tatashin
2019-07-08 21:15 ` [v1 2/5] kexec: add resource for normal kexec region Pavel Tatashin
2019-07-08 21:15 ` [v1 3/5] kexec: export common crashkernel/kexeckernel parser Pavel Tatashin
2019-07-08 21:15 ` [v1 4/5] kexec: use reserved memory for normal kexec reboot Pavel Tatashin
2019-07-08 21:15 ` [v1 5/5] arm64, kexec: reserve kexeckernel region Pavel Tatashin
2019-07-08 23:53 ` Eric W. Biederman [this message]
2019-07-09  0:09   ` [v1 0/5] allow to reserve memory for normal kexec kernel Pavel Tatashin
2019-07-09 10:18     ` James Morse
2019-07-09 10:36 ` Bhupesh Sharma
2019-07-09 10:55   ` Pavel Tatashin
2019-07-09 11:59     ` James Morse
2019-07-09 13:07       ` Pavel Tatashin
2019-07-10 15:19         ` James Morse
2019-07-10 15:56           ` Pavel Tatashin
2019-07-11  8:12             ` Vladimir Murzin
2019-07-11 12:26               ` 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=87sgrgjd6i.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=jmorris@namei.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=sashal@kernel.org \
    --cc=will@kernel.org \
    /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).