On Tue, Feb 12, 2019 at 12:38 PM Christoph Hellwig <h...@infradead.org> wrote: > > On Sat, Jan 19, 2019 at 01:28:59PM +0000, Anup Patel wrote: > > This patch implements keepinitrd kernel parameter. By default, > > keepinitrd=1 but users can pass "keepinitrd=0" to free-up > > initrd memory at boot-time in free_initrd_mem() function. > > > > The keepinitrd kernel parameter is already implemented by > > unicore32, arm, and arm64 architectures and it is documented > > at: Documentation/admin-guide/kernel-parameters.txt > > But why do we need it? Is there any good reason every not to free > the initrd / initramfs memory when it is not used?
If it is initramfs (i.e. CPIO image) then contents of CPIO archive are extracted to create a ramfs instance. If it is initrd (i.e. some filesystem image) then RAM block device is created in-place at initrd location. (Please correct me if I am wrong about initrd here). So in case of initrd we might not want to free-up the RAM but we can certainly free-up in case of initramfs. Regards, Anup