Skip to content

Commit

Permalink
Merge pull request #2866 from shirishaganta1/htx_dlpar
Browse files Browse the repository at this point in the history
Added condition to remove only 40% memory removal during workloads
  • Loading branch information
PraveenPenguin authored Aug 5, 2024
2 parents c6e3ee4 + bab6239 commit 8153a29
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dlpar/dlpar_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ def mem_payload_data(curr_mem, lmb, max_value=0):
result_list = []
current_sum = 0
index_value = lmb
cmd = 'htxcmdline -query -mdt mdt.*'
if max_value == 0:
# Calculate 80% of curr_mem
max_value = curr_mem * 0.8
cmd_output = process.system_output(cmd, ignore_status=True).decode()
if 'IDLE' not in cmd_output:
max_value = curr_mem * 0.4
else:
# Calculate 80% of curr_mem
max_value = curr_mem * 0.8
# Ensure max_value is divisible by lmb
max_value += lmb - (max_value % lmb)
current_sum = 0
Expand Down Expand Up @@ -368,6 +373,8 @@ def test_mix_cpu(self):
self.fail("Cpu remove Command failed \
please check the logs")
self.log.info("====>%s cpu got removed====>\n " % vp)
file_to_remove = 'config.txt'
os.remove(file_to_remove)

def test_mem_add(self):
Mem_obj = Memory(self.sorted_payload, log='memory.log')
Expand Down Expand Up @@ -426,8 +433,6 @@ def test_mem_mix(self):
self.fail("MEM remove Command failed please check the logs")
self.log.info(
"====>%s memory got removed====>\n " % rem)
file_to_remove = 'config.txt'
os.remove(file_to_remove)

def test_cpu_move(self):
if self.lpar_mode == 'dedicated':
Expand Down

0 comments on commit 8153a29

Please sign in to comment.