RFC initramfs: reduce buffer footprint
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest6 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | vsprintf: add simple_strntoulinclude/ lib/ | +8 | 0 replies | |
| 2/6 | initramfs: avoid memcpy for hex header fieldsinit/ | +3 | 0 replies | |
| 3/6 | initramfs: remove extra symlink path bufferinit/ | +5 | 0 replies | |
| 4/6 | initramfs: merge header_buf and name_bufinit/ | +13 | 0 replies | |
| 5/6 | initramfs: reuse buf for built-in and bootloader initramfsinit/ | +14 | 0 replies | |
| 6/6 | initramfs: avoid static buffer for error messageinit/ | +5 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/6] initramfs: reduce buffer footprint
There are a number of stack, heap and data-segment buffers which are unnecessary for initramfs unpacking. This patchset attempts to remove them by:
- parsing cpio hex strings in place, instead of copying them for nul-termination. (Patches 1 & 2).
- reusing a single heap buffer for cpio header, file and symlink paths, instead of three separate buffers. (Patches 3 & 4).
- reusing the heap-allocated cpio buffer across both builtin and bootloader-provided unpack attempts. (Patch 5).
- reusing the heap-allocated cpio buffer for error messages on FSM-exit, instead of a data-segment buffer. (Patch 6).
I've flagged this as an RFC as I'd like to improve the commit messages and also provide more thorough testing, likely via kunit / kselftest integration.
Feedback appreciated.
David Disseldorp (6):
vsprintf: add simple_strntoul
initramfs: avoid memcpy for hex header fields
initramfs: remove extra symlink path buffer
initramfs: merge header_buf and name_buf
initramfs: reuse buf for built-in and bootloader initramfs
initramfs: avoid static buffer for error message
include/linux/kstrtox.h | 1 + init/initramfs.c | 50 +++++++++++++++++++++-------------------- lib/vsprintf.c | 7 ++++++ 3 files changed, 34 insertions(+), 24 deletions(-)