initramfs: panic with memory information
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 26 Feb 2021 01:22:46 +0000 (17:22 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Feb 2021 17:41:05 +0000 (09:41 -0800)
commitdd23e8098f33a55b22b869bc7fc0a795ccbb9f87
tree54d1cfdef6cacc7250efd48520ac5737e9aac736
parent6aaa31aeb9cf260e1b7155cc11ec864f052db5ec
initramfs: panic with memory information

On systems with large amounts of reserved memory we may fail to
successfully complete unpack_to_rootfs() and be left with:

 Kernel panic - not syncing: write error

this is not too helpful to understand what happened, so let's wrap the
panic() calls with a surrounding show_mem() such that we have a chance of
understanding the memory conditions leading to these allocation failures.

[akpm@linux-foundation.org: replace macro with C function]

Link: https://lkml.kernel.org/r/20210114231517.1854379-1-f.fainelli@gmail.com
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Barret Rhoden <brho@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/initramfs.c