On 12/21/20 12:16 AM, Sourabh Jain wrote:
Yes, it is a challenge.
I had thought about something like "lsmem", but hesitate because
reserve_crashkernel() evaluates memory size by ioresource, which is
present to user space through /proc/iomem.
While lsmem has a coarse grain, and can not realize the actual memory
size of non full populated memory block. Also it does not work on RHEL8
arm64 platform. (this API library is not only for FFDC, so we also want
it can run on other platforms )
Yeah agree. Just wanted to confirm that the script behaviour for non-root user is
/proc/iomem is supported on arm64/s390x/powerpc/x86. For other
platforms, we just omit them.
Agree. But is it possible to have else condition
where we find ck_cmdline based on the architecture type and exit if unsupported
architecture found? This way we can avoid calling get_system_size and get_recommend_size
function because we already know the result generated by this function is anyways not
Except small optimization on unsupported architecture, the script looks good to me.