Hi Philipp,
On Mon, Aug 01, 2022 at 04:58:21PM +0200, Philipp Rudo wrote:
Hi Coiby,
On Tue, 21 Jun 2022 14:57:25 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
> By default, NetworkManger will manage all the network interfaces and
> try to set interface IFF_UP to get carrier state. Regardless of whether
> the network interface is connected to a cable or not, the NIC driver
> will allocate memory resources for e.g. ring buffers when setting IFF_UP.
> This could be a waste of memory. For example it's found i40e consumes ~15GB
> on a power machine. On this machine, i40e manages four interfaces but only
> one interface is valid. This patch use "managed=false" to tell
> NetworkManager to not manage network interfaces that are not needed by
> kdump by putting /etc/NetworkManager/conf.d/10-kdump-netif.conf in the
> initramfs.
>
> Signed-off-by: Coiby Xu <coxu(a)redhat.com>
> ---
> dracut-module-setup.sh | 34 +++++++++++++++++++++++++++++++++-
> 1 file changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index 9ae3dd1..2a15e5e 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -1,6 +1,7 @@
> #!/bin/bash
>
> _DRACUT_KDUMP_NM_TMP_DIR="/tmp/$$-DRACUT_KDUMP_NM"
> +_TMP_KDUMP_NETIFS="$_DRACUT_KDUMP_NM_TMP_DIR/kdump_netifs"
Could you use a bash array instead of a file here? That would reduce
the number of file operations.
I just tried using a bash array but an unexpected problem is this
variable could be modified in a subshell thus the change doesn't
persist. It seems I have to use a file unless we avoid calling all
kdump_setup_{bond,bridge...} in a subshell.
Thanks
Philipp
--
Best regards,
Coiby