Bug 2120188

Summary: shutdown those unneeded network interfaces to save memory for kdump
Product: Red Hat Enterprise Linux 9 Reporter: Coiby <coxu>
Component: kexec-toolsAssignee: Coiby <coxu>
Status: CLOSED ERRATA QA Contact: Jie Li <jieli>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.2CC: cye, ruyang, yiyan
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kexec-tools-2.0.25-7.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1950282 Environment:
Last Closed: 2023-05-09 08:14:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1950282    
Bug Blocks:    
Deadline: 2022-12-19   

Description Coiby 2022-08-22 05:59:28 UTC
+++ This bug was initially created as a clone of Bug #1950282 +++

Description of problem:

Even with no carrier, a network interface is requested up, i.e., t IFF_UP flag is set. Thus netdev_ops->ndo_open is called to allocate the memory resources. For example, it's observed on ibm-p9b-19.ibm2.lab.eng.bos.redhat.com for the first kernel, i40e consumed ~15GB memory. If we shutdown those inactive network interfaces by "ip link set dev enP2p1s0fX down" would reduce the memory consumption from 16899MB to 5438MB,
```
[root@ibm-p9b-19 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:          63185       16899       44118          22        2167       45221
Swap:         32607           0       32607

[root@ibm-p9b-19 ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enP2p1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether ac:1f:6b:56:e7:9c brd ff:ff:ff:ff:ff:ff
    inet 10.16.214.110/23 brd 10.16.215.255 scope global dynamic noprefixroute enP2p1s0f0
       valid_lft 70363sec preferred_lft 70363sec
    inet6 2620:52:0:10d6:ae1f:6bff:fe56:e79c/64 scope global dynamic noprefixroute 
       valid_lft 2591884sec preferred_lft 604684sec
    inet6 fe80::ae1f:6bff:fe56:e79c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: enP2p1s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:56:e7:9d brd ff:ff:ff:ff:ff:ff
4: enP2p1s0f2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:56:e7:9e brd ff:ff:ff:ff:ff:ff
5: enP2p1s0f3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:56:e7:9f brd ff:ff:ff:ff:ff:ff
[root@ibm-p9b-19 ~]# ip link set dev enP2p1s0f1 down
[root@ibm-p9b-19 ~]# ip link set dev enP2p1s0f2 down
[root@ibm-p9b-19 ~]# ip link set dev enP2p1s0f3 down
[root@ibm-p9b-19 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:          63185        5438       55579          22        2167       56682
Swap:         32607           0       32607
[root@ibm-p9b-19 ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enP2p1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether ac:1f:6b:56:e7:9c brd ff:ff:ff:ff:ff:ff
    inet 10.16.214.110/23 brd 10.16.215.255 scope global dynamic noprefixroute enP2p1s0f0
       valid_lft 70330sec preferred_lft 70330sec
    inet6 2620:52:0:10d6:ae1f:6bff:fe56:e79c/64 scope global dynamic noprefixroute 
       valid_lft 2591852sec preferred_lft 604652sec
    inet6 fe80::ae1f:6bff:fe56:e79c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: enP2p1s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:56:e7:9d brd ff:ff:ff:ff:ff:ff
4: enP2p1s0f2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:56:e7:9e brd ff:ff:ff:ff:ff:ff
5: enP2p1s0f3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:56:e7:9f brd ff:ff:ff:ff:ff:ff
```

kexec-tools should shutdown those unneeded network interfaces to save memory. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 7 errata-xmlrpc 2023-05-09 08:14:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (kexec-tools bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2463