Hi Coiby,
On Mon, 5 Sep 2022 18:24:37 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
Currently, "kdumpctl estimate" neglects the memory overhead
cost of
cryptsetup itself. Unfortunately, there is no golden formula to
calculate the overhead cost [1]. So estimate the overhead cost as 50M
for aarch64 and 20M for other architectures based on the following
empirical data,
| Overhead (M) | OS | arch |
| ------------ | ----------------------------------------- | ------- |
| 14.1 | RHEL-9.2.0-20220829.d.1 | ppc64le |
| 14 | Fedora-37-20220830.n.0 Everything ppc64le | ppc64le |
| 17 | Fedora 36 | ppc64le |
| 8.8 | Fedora 35 | s390x |
| 10.1 | Fedora-Rawhide-20220829.n.0, fc38 | s390x |
| 42 | Fedora-Rawhide-20220829.n.0, fc38 | arch64 |
| 40 | F35 | arch64 |
| 42 | F36 | arch64 |
| 42 | Fedora-Rawhide-20220901.n.0 | arch64 |
| 10 | F35 | x86_64 |
| 10 | Fedora-Rawhide-20220901.n.0 | x86_64 |
| 11 | Fedora-Rawhide-20220901.n.0 | x86_64 |
this approach isn't very elegant but looks like it's the best we can
do. At least it's better than before ;-)
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
P.S. do_estimate is slowly getting pretty long and hard to read. Maybe
it's worth to split it up next time we work on it.
[1]
https://lore.kernel.org/cryptsetup/20220616044339.376qlipk5h2omhx2@Rk/T/#u
Fixes: e9e6a2c ("kdumpctl: Add kdumpctl estimate")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index ee40d33..18abdd7 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1192,7 +1192,7 @@ do_estimate()
local kdump_mods
local -A large_mods
local baseline
- local kernel_size mod_size initrd_size baseline_size runtime_size reserved_size
estimated_size recommended_size
+ local kernel_size mod_size initrd_size baseline_size runtime_size reserved_size
estimated_size recommended_size _cryptsetup_overhead
local size_mb=$((1024 * 1024))
setup_initrd
@@ -1246,7 +1246,17 @@ do_estimate()
break
done
done
- [[ $crypt_size -ne 0 ]] && echo -e "Encrypted kdump target requires extra
memory, assuming using the keyslot with minimun memory requirement\n"
+
+ if [[ $crypt_size -ne 0 ]]; then
+ if [[ $(uname -m) == aarch64 ]]; then
+ _cryptsetup_overhead=50
+ else
+ _cryptsetup_overhead=20
+ fi
+
+ crypt_size=$((crypt_size + _cryptsetup_overhead * size_mb))
+ echo -e "Encrypted kdump target requires extra memory, assuming using the keyslot
with minimun memory requirement\n"
+ fi
estimated_size=$((kernel_size + mod_size + initrd_size + runtime_size + crypt_size))
if [[ $baseline_size -gt $estimated_size ]]; then