[spyre] Update the ulimit for the sentient group#37
[spyre] Update the ulimit for the sentient group#37sahithiRavindranath wants to merge 2 commits intolinux-ras:spyrefrom
Conversation
5e6aded to
3a6673c
Compare
| line_str = line_match.group(1) | ||
| line_value = line_match.group(2) | ||
| conf_str = conf_match.group(1) | ||
| if line_str == conf_str: |
There was a problem hiding this comment.
Can you define a function push the above logic there? Add some documentation for that function.
| config_file) | ||
|
|
||
| status = True | ||
| pattern = r'^(.+?)\s+(unlimited|\d+)$' |
There was a problem hiding this comment.
Please add an example that matches with above patter.
If the currently set ulimit value is higher than the configured limit, it does not need to be reduced, as higher values are harmless. The validation parses the configuration and checks the memlimit value. If the currently set memlimit is greater than or equal to the configured value, the check passes; otherwise, it fails. Signed-off-by: Sahithi Ravindranath <Sahithi.Ravindranath@ibm.com>
3a6673c to
4401e6a
Compare
| conf_check.set_status(status) | ||
| return conf_check | ||
|
|
||
| def verify_if_memlimit_config_is_valid(self, conf_check, |
There was a problem hiding this comment.
How about is_mem_limit_config_valid?
| conf_check.set_status(status) | ||
| return conf_check | ||
|
|
||
| def verify_if_memlimit_config_is_valid(self, conf_check, |
There was a problem hiding this comment.
This is a of helper function so add some document of top of this function:
"""
Short one-line summary of what the function does.
More detailed explanation if needed. Describe the purpose,
behavior, and any important implementation notes.
Args:
arg1 (type): Description of arg1.
arg2 (type): Description of arg2.
optional_arg (type, optional): Description of optional_arg.
Defaults to None.
Returns:
return_type: Description of what is returned.
"""
|
|
||
| # Patterns to parse sentient 1234, memlock ulimited, | ||
| # memlock 7890, sentient memlock unlimited | ||
| pattern = r'^(.+?)\s+(unlimited|\d+)$' |
There was a problem hiding this comment.
Add example string that matches the above patter.
| or (int(line_value) >= int(conf_value))): | ||
| conf_check.add_attribute(line, True, None, None) | ||
| vfio_mem_conf.remove(conf) | ||
|
|
There was a problem hiding this comment.
Seems like this function is more that just verify the config. I expect the verify function to return bool.
Please improve the function name, add some empty lines after every logical code blocks.
multi-card spyre containers eventually runs out of locked memory and can cause the containers to exit. Updating the memlock config to the max value containers might consume based on the number of cards in the system would prevent the containers exiting due to locked memory exhaustion. Signed-off-by: Sahithi Ravindranath <Sahithi.Ravindranath@ibm.com>
4401e6a to
174f82c
Compare
For multi-card spyre containers eventually runs out of locked memory and caused the conatiners to exit.
Updating the memlock config to the max value containers might consume based on the number of cards in the system