[PATCH] kexec: use mmap instead of read for slurp_file()

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

 



On Fri, Sep 04, 2015 at 02:11:59PM +0200, 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
> 
> Therefore use mmap() for non-character devices to reduce the runtime
> memory consumption of the kexec tool.
> 
> The following use case illustrates the usefulness of this patch a bit more:
> 
>  1) Boot a 4 GB Linux system
>  2) Read kernel and 1,5 GB ramdisk from external source into local tmpfs (ram)
>  3) kexec the kernel and ramdisk
> 
>  Without this patch for the kexec runtime we need:
> 
>  1,5 GB (tmpfs) + 1,5 GB (kexec malloc) + 1,5 GB (kernel memory) = 4,5 GB
> 
> Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>

Thanks, applied.



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux