config: don't open demote file

The Linux kernel commit
<hugetlb: add demote hugetlb page sysfs interfaces>
can cause "configure_controller" process failure when installing
using jenkins job.
Refer to: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/commit/?id=79dfc695525f60c8410015362b8aa4eb5c57210c
This commit introduces new interfaces such as:
/sys/devices/system/node/node0/hugepages/hugepages-1048576kB/demote
/sys/devices/system/node/node0/hugepages/hugepages-1048576kB/demote_size
The "demote" file is a write-only file here.
The code in node.py opens up the files for reading without even
checking if they are valid to read. This causes the failure in
"configure_controller" process.

Test plan:
 The out of tree kernel modules for 6.6 aren't ready by now.
 So many tests can't be done yet because the related test environments
 need those OOT drivers. Here list the tests which have been done with
 a test patch to remove the OOT drivers from the ISO temporarily.
 PASS: Build sysinv OK.
 PASS: Build ISO OK.
 PASS: Install and boot up OK on an AIO-SX lab with std/rt kernel
       by jenkins jobs.

Thanks M. Vefa Bicakci for the solution.

Story: 2011000
Task: 49365

Change-Id: I99fc88f87dfe55723d0e21780c39a759b8fa680a
Signed-off-by: Li Zhou <li.zhou@windriver.com>
This commit is contained in:
Li Zhou 2024-02-04 23:51:03 -08:00
parent da0162a109
commit 3833171c6b
1 changed files with 4 additions and 3 deletions

View File

@ -362,10 +362,11 @@ class NodeOperator(object):
if files:
for file in files:
with open(mydir + '/' + file, 'r') as f:
if file.startswith("nr_hugepages"):
if file.startswith("nr_hugepages"):
with open(mydir + '/' + file, 'r') as f:
nr_hugepages = int(f.readline())
if file.startswith("free_hugepages"):
if file.startswith("free_hugepages"):
with open(mydir + '/' + file, 'r') as f:
free_hugepages = int(f.readline())
total_hp_mb = total_hp_mb + int(nr_hugepages * size)