Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysfs: enable faking CPU cache configurations using OVERRIDE_SYS_CACHES #383

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

askervin
Copy link
Collaborator

This PR is an enabler for testing CPU allocations when there are several CPUs that share the same level 2 cache.

If the first saved cache was from level 3, saving level 1 after that
crashed on a nil map. This change makes sure that there are no nil
maps in sys.caches in the saved or levels below that.

Signed-off-by: Antti Kervinen <[email protected]>
@klihub klihub self-requested a review October 16, 2024 15:57
pkg/sysfs/system.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@klihub klihub left a comment

Choose a reason for hiding this comment

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

LGTM, although I have a small nitgestion about consistency with core kind overrrides, IOW to fail on parse errors instead of logging the errors but then starting up with a wrong emulated cache layout... considering that this is intended for test use.

If OVERRIDE_SYS_CACHES environment variable is defined, discovering
CPU cache configuration from sysfs is skipped and the configuration is
parsed from the json in the variable instead.

Signed-off-by: Antti Kervinen <[email protected]>
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