Skip to content

Commit

Permalink
Merge pull request #788 from shirishaganta1/fix-os-code-issue
Browse files Browse the repository at this point in the history
Fix OS config issue
  • Loading branch information
PraveenPenguin authored Oct 3, 2023
2 parents 7e75b5a + a727123 commit 35ee74b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions testcases/MachineConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ def __init__(self, cv_HMC=None, system_name=None,
self.hmc_con = self.cv_HMC.ssh
self.mmulist = self.c.run_command("tail /proc/cpuinfo | grep MMU")
self.mmu = str(self.mmulist[0]).split(':')[1].strip()
self.cmdline = self.c.run_command("cat /proc/cmdline | grep -o disable_radix=1")
self.obj = OpTestInstallUtil.InstallUtil()
self.os_level = self.cv_HOST.host_get_OS_Level()
self.size_hgpg = hugepage
Expand Down Expand Up @@ -470,6 +471,10 @@ def OsHugepageSetup(self):
exist_cfg = self.cv_HMC.get_lpar_cfg()
self.des_mem = int(exist_cfg.get('desired_mem'))
self.percentile = int(self.des_mem * 0.1)
if 'disable_radix=1' in self.cmdline and 'Hash' in self.mmu:
self.obj.update_kernel_cmdline(self.os_level, remove_args="disable_radix=1",
reboot=False, reboot_cmd=False)
self.mmu = 'Radix'
if 'Radix' in self.mmu:
if self.size_hgpg == "16M":
self.fail("16M is not supported in Radix")
Expand All @@ -481,8 +486,8 @@ def OsHugepageSetup(self):
elif 'Hash' in self.mmu and self.size_hgpg == "16M":
self.no_hgpg = int(self.percentile / 16)
self.obj.update_kernel_cmdline(self.os_level,
"hugepagesz=%s hugepages=%s" % (
self.size_hgpg, self.no_hgpg),
"default_hugepagesz=%s hugepagesz=%s hugepages=%s" % (
self.size_hgpg, self.size_hgpg, self.no_hgpg),
"",
reboot=True,
reboot_cmd=True)
Expand Down

0 comments on commit 35ee74b

Please sign in to comment.