Skip to content

[spyre] Update the ulimit for the sentient group#37

Open
sahithiRavindranath wants to merge 2 commits intolinux-ras:spyrefrom
sahithiRavindranath:spyrenew
Open

[spyre] Update the ulimit for the sentient group#37
sahithiRavindranath wants to merge 2 commits intolinux-ras:spyrefrom
sahithiRavindranath:spyrenew

Conversation

@sahithiRavindranath
Copy link

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

@sahithiRavindranath sahithiRavindranath force-pushed the spyrenew branch 5 times, most recently from 5e6aded to 3a6673c Compare February 11, 2026 09:10
line_str = line_match.group(1)
line_value = line_match.group(2)
conf_str = conf_match.group(1)
if line_str == conf_str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define a function push the above logic there? Add some documentation for that function.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

config_file)

status = True
pattern = r'^(.+?)\s+(unlimited|\d+)$'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an example that matches with above patter.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

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>
conf_check.set_status(status)
return conf_check

def verify_if_memlimit_config_is_valid(self, conf_check,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
"""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


# Patterns to parse sentient 1234, memlock ulimited,
# memlock 7890, sentient memlock unlimited
pattern = r'^(.+?)\s+(unlimited|\d+)$'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add example string that matches the above patter.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

or (int(line_value) >= int(conf_value))):
conf_check.add_attribute(line, True, None, None)
vfio_mem_conf.remove(conf)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added and improved

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants