Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: stefan.roscher@de.ibm.com, kexec@lists.infradead.org,
	Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH v3] kexec/s390x: use mmap instead of read for slurp_file()
Date: Mon, 9 Nov 2015 10:59:15 +0900	[thread overview]
Message-ID: <20151109015915.GA7407@verge.net.au> (raw)
In-Reply-To: <20151030160204.6cf76607@holzheu>

On Fri, Oct 30, 2015 at 04:02:04PM +0100, Michael Holzheu wrote:
> The slurp_fd() function allocates memory and uses the read() system call.
> This results in double memory consumption for image and initrd:
> 
>  1) Memory allocated in user space by the kexec tool
>  2) Memory allocated in kernel by the kexec() system call
> 
> The following illustrates the use case that we have on s390x:
> 
>  1) Boot a 4 GB Linux system
>  2) Copy kernel and 1,5 GB ramdisk from external source into tmpfs (ram)
>  3) Use kexec to boot kernel with ramdisk
> 
>  Therefore for kexec runtime we need:
> 
>  1,5 GB (tmpfs) + 1,5 GB (kexec malloc) + 1,5 GB (kernel memory) = 4,5 GB
> 
> This patch introduces slurp_file_mmap() which for "normal" files uses
> mmap() instead of malloc()/read(). This reduces the runtime memory
> consumption of the kexec tool as follows:
> 
>  1,5 GB (tmpfs) + 1,5 GB (kernel memory) = 3 GB
> 
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> Reviewed-by: Dave Young <dyoung@redhat.com>

Thanks, applied.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-11-09  1:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23  3:10 [PATCH] Revert "kexec: use mmap instead of read for slurp_file()" Dave Young
2015-10-23 15:09 ` Michael Holzheu
2015-10-26  7:31   ` Dave Young
2015-10-27 12:35     ` [PATCH v2] kexec/s390x: use mmap instead of read for slurp_file() Michael Holzheu
2015-10-28  6:46       ` Dave Young
2015-10-28  9:57         ` Michael Holzheu
2015-10-29  6:37           ` Dave Young
2015-10-29 15:26             ` Michael Holzheu
2015-10-30  2:03               ` Dave Young
2015-10-30 10:13                 ` Michael Holzheu
2015-10-30 13:39                   ` Dave Young
2015-10-30 15:02                     ` [PATCH v3] " Michael Holzheu
2015-11-09  1:59                       ` Simon Horman [this message]
2015-10-26  4:30 ` [PATCH] Revert "kexec: use mmap instead of read for slurp_file()" Simon Horman
2015-11-03  0:11 ` Geoff Levand
2015-11-03  1:15   ` Dave Young

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=20151109015915.GA7407@verge.net.au \
    --to=horms@verge.net.au \
    --cc=dyoung@redhat.com \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=stefan.roscher@de.ibm.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