Skip to content

Commit

Permalink
Merge pull request #866 from SamirMulani/shared_mode_fix
Browse files Browse the repository at this point in the history
Fixed the issue for seating the shared mode  EC vs VP value.
  • Loading branch information
PraveenPenguin authored Oct 1, 2024
2 parents 5db3712 + ef9f384 commit 59e31e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
17 changes: 14 additions & 3 deletions common/OpTestHMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,23 @@ def change_proc_mode(self, proc_mode, sharing_mode, min_proc_units, desired_proc
:param overcommit_ratio: overcommit ratio can be 1 to 5 for ideal cases
'''
if proc_mode == 'shared':
'''
Get the maximum configured virtual procs
'''
v_max_proc = 0
max_virtual_proc = self.run_command("lshwres -m %s -r proc --level sys -F curr_sys_virtual_procs" % (self.mg_system))
max_virtual_proc = int(max_virtual_proc[0])
if overcommit_ratio*int(max_proc_units) > max_virtual_proc:
v_max_proc = max_virtual_proc
else:
v_max_proc = overcommit_ratio*int(max_proc_units)

self.set_lpar_cfg("proc_mode=shared,sharing_mode=%s,min_proc_units=%s,max_proc_units=%s,"
"desired_proc_units=%s,min_procs=%s,desired_procs=%s,max_procs=%s,"
"min_mem=%s,desired_mem=%s,max_mem=%s" %
(sharing_mode, overcommit_ratio*int(min_proc_units), max_proc_units, overcommit_ratio*int(desired_proc_units),
int(min_proc_units), 2*int(desired_proc_units),
2*int(max_proc_units), min_memory, desired_memory, max_memory))
(sharing_mode, min_proc_units, max_proc_units, desired_proc_units,
overcommit_ratio*int(min_proc_units), overcommit_ratio*int(desired_proc_units), v_max_proc,
min_memory, desired_memory, max_memory))
elif proc_mode == 'ded':
self.set_lpar_cfg("proc_mode=ded,sharing_mode=%s,min_procs=%s,max_procs=%s,desired_procs=%s,"
"min_mem=%s,desired_mem=%s,max_mem=%s" %
Expand Down
5 changes: 2 additions & 3 deletions testcases/MachineConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ def LparSetup(self, lpar_config=""):
except AttributeError:
self.desired_proc_units = 2.0
try:
self.max_proc_units = int(float(
self.cv_HMC.get_available_proc_resources()[0])) + self.cv_HMC.get_stealable_proc_resources_lpar()
self.max_proc_units = float(conf.args.max_proc_units)
except AttributeError:
self.max_proc_units = 2.0
self.max_proc_units = int(float(self.cv_HMC.get_available_proc_resources()[0])) + self.cv_HMC.get_stealable_proc_resources_lpar()
try:
self.overcommit_ratio = int(conf.args.overcommit_ratio)
except AttributeError:
Expand Down

0 comments on commit 59e31e5

Please sign in to comment.