android_kernel_motorola_sm6375/Documentation
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Lichen Liu 6ad65ae94d fs: Add 'initramfs_options' to set initramfs mount options
[ Upstream commit 278033a225e13ec21900f0a92b8351658f5377f2 ]

When CONFIG_TMPFS is enabled, the initial root filesystem is a tmpfs.
By default, a tmpfs mount is limited to using 50% of the available RAM
for its content. This can be problematic in memory-constrained
environments, particularly during a kdump capture.

In a kdump scenario, the capture kernel boots with a limited amount of
memory specified by the 'crashkernel' parameter. If the initramfs is
large, it may fail to unpack into the tmpfs rootfs due to insufficient
space. This is because to get X MB of usable space in tmpfs, 2*X MB of
memory must be available for the mount. This leads to an OOM failure
during the early boot process, preventing a successful crash dump.

This patch introduces a new kernel command-line parameter,
initramfs_options, which allows passing specific mount options directly
to the rootfs when it is first mounted. This gives users control over
the rootfs behavior.

For example, a user can now specify initramfs_options=size=75% to allow
the tmpfs to use up to 75% of the available memory. This can
significantly reduce the memory pressure for kdump.

Consider a practical example:

To unpack a 48MB initramfs, the tmpfs needs 48MB of usable space. With
the default 50% limit, this requires a memory pool of 96MB to be
available for the tmpfs mount. The total memory requirement is therefore
approximately: 16MB (vmlinuz) + 48MB (loaded initramfs) + 48MB (unpacked
kernel) + 96MB (for tmpfs) + 12MB (runtime overhead) ≈ 220MB.

By using initramfs_options=size=75%, the memory pool required for the
48MB tmpfs is reduced to 48MB / 0.75 = 64MB. This reduces the total
memory requirement by 32MB (96MB - 64MB), allowing the kdump to succeed
with a smaller crashkernel size, such as 192MB.

An alternative approach of reusing the existing rootflags parameter was
considered. However, a new, dedicated initramfs_options parameter was
chosen to avoid altering the current behavior of rootflags (which
applies to the final root filesystem) and to prevent any potential
regressions.

Also add documentation for the new kernel parameter "initramfs_options"

This approach is inspired by prior discussions and patches on the topic.
Ref: https://www.lightofdawn.org/blog/?viewDetailed=00128
Ref: https://landley.net/notes-2015.html#01-01-2015
Ref: https://lkml.org/lkml/2021/6/29/783
Ref: https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html#what-is-rootfs

Signed-off-by: Lichen Liu <lichliu@redhat.com>
Link: https://lore.kernel.org/20250815121459.3391223-1-lichliu@redhat.com
Tested-by: Rob Landley <rob@landley.net>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-10-29 13:59:55 +01:00
..
ABI scsi: ufs: core: Fix spelling of a sysfs attribute name 2025-07-17 18:24:58 +02:00
accounting psi: Fix uaf issue when psi trigger is destroyed while being polled 2022-02-05 12:35:36 +01:00
admin-guide fs: Add 'initramfs_options' to set initramfs mount options 2025-10-29 13:59:55 +01:00
arm
arm64 arm64: errata: Expand speculative SSBS workaround once more 2024-11-08 16:20:42 +01:00
block
bpf
cdrom
core-api
cpu-freq
crypto
dev-tools docs/scripts/gdb: add necessary make scripts_gdb step 2023-03-11 16:43:57 +01:00
devicetree dt-bindings: mmc: controller: clarify the address-cells description 2025-03-13 12:42:53 +01:00
doc-guide
driver-api spi: Update reference to struct spi_controller 2023-01-18 11:41:01 +01:00
EDID
fault-injection debugfs: fix error when writing negative value to atomic_t debugfs file 2023-01-18 11:40:56 +01:00
fb
features
filesystems rename(): fix the locking of subdirectories 2024-02-23 08:24:49 +01:00
firmware-guide Documentation: ACPI: Fix parent device references 2025-08-28 16:21:23 +02:00
firmware_class
fpga
gpu
hid
hwmon Revert "hwmon: Make chip parameter for with_info API mandatory" 2022-06-25 12:44:36 +02:00
i2c
ia64
ide
iio
infiniband
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-09-20 12:27:59 +02:00
ioctl Remove DECnet support from kernel 2023-06-21 15:44:10 +02:00
isdn
kbuild
kernel-hacking
leds
livepatch
locking
m68k
maintainer
media media: rename VFL_TYPE_GRABBER to _VIDEO 2024-03-26 18:22:22 -04:00
mic
mips
misc-devices
netlabel
networking xsk: Honor SO_BINDTODEVICE on bind 2023-07-27 08:37:23 +02:00
nios2
openrisc
parisc
PCI
pcmcia
power PM: runtime: Add pm_runtime_get_if_active() 2023-08-30 16:27:12 +02:00
powerpc
process overflow: Implement size_t saturating arithmetic helpers 2024-09-04 13:14:51 +02:00
RCU
riscv
s390
scheduler
scsi
security
sh
sound ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument 2024-02-23 08:25:00 +01:00
sparc
sphinx docs: kernel_include.py: Cope with docutils 0.21 2024-05-25 16:17:18 +02:00
sphinx-static
spi
target
timers sched/isolation: Prevent boot crash when the boot CPU is nohz_full 2025-04-10 14:29:35 +02:00
trace tracing/histogram: Update document for KEYS_MAX size 2022-11-10 17:57:55 +01:00
translations media: rename VFL_TYPE_GRABBER to _VIDEO 2024-03-26 18:22:22 -04:00
usb
userspace-api
virt KVM: s390: disable migration mode when dirty tracking is disabled 2023-03-11 16:44:01 +01:00
virtual
vm arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 19:54:46 +02:00
w1
watchdog
x86
xtensa
.gitignore
asm-annotations.rst
atomic_bitops.txt locking/atomic: Make test_and_*_bit() ordered on failure 2022-08-25 11:18:31 +02:00
atomic_t.txt
bus-virt-phys-mapping.txt
Changes
CodingStyle
conf.py docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 2022-06-14 18:11:49 +02:00
COPYING-logo
crc32.txt
debugging-modules.txt
debugging-via-ohci1394.txt
digsig.txt
DMA-API-HOWTO.txt
DMA-API.txt
DMA-attributes.txt Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" 2022-05-25 09:14:38 +02:00
DMA-ISA-LPC.txt
docutils.conf
dontdiff
futex-requeue-pi.txt
hwspinlock.txt
index.rst
io-mapping.txt
io_ordering.txt
IPMI.txt ipmi: docs: don't advertise deprecated sysfs entries 2024-11-08 16:20:29 +01:00
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
Kconfig
kobject.txt
kprobes.txt
kref.txt
logo.gif
lzo.txt
mailbox.txt
Makefile
memory-barriers.txt
nommu-mmap.txt
padata.txt
percpu-rw-semaphore.txt
pi-futex.txt
preempt-locking.txt
rbtree.txt
remoteproc.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
speculation.txt
static-keys.txt
SubmittingPatches
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
xz.txt