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

sysdetect: Fix infinite loop for heterogeneous processors #271

Closed
wants to merge 2 commits into from

Conversation

willowec
Copy link
Contributor

Pull Request Description

This PR fixes #256 by allowing the problem function to exit. However, this PR does not add support for heterogeneous CPU detection to sysdetect and is more of a quick fix to ensure ./utils/papi_hardware_avail and the sysdetect tests fail. Additionally, while working on this I noticed that on Intel Raptorlake cpu_get_cache_info() fails to get information for the 4th cache level because the check to ensure no writes are made off the end of the cache level array is too strict. This PR allows the entire array to be used.

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

The cpu_get_cache_info() function has a check that ensures the level of
cache info being acquired is within the bounds of the allowed number of
memory levels PAPI supports (PAPI_MAX_MEM_HIERARCHY_LEVELS). Previously
the check has used >= instead of >, preventing the last entry from being
used, causing the function to error out on the last level of the cache
on Intel Raptorlake. Change the check to allow the entire array to be
used.
Because the sysdetect component is designed to assume homogeneous cores,
heterogeneous CPUs like Intel Raptorlake can have the total number of
available threads be overestimated. The worst impact of this is an
infinite loop in get_thread_affinity() of linux_cpu_utils.c. Fix
infinite loop by adding a check to ensure /sys/ entry exists for the
target thread.
Copy link
Contributor

@adanalis adanalis left a comment

Choose a reason for hiding this comment

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

This is not sufficient to fix the problem with sysdetect. Please check open PR #269

@willowec willowec closed this Oct 30, 2024
@willowec willowec deleted the het-sysdetect branch October 30, 2024 13:43
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.

sysdetect: all tests hang on Intel Raptorlake
2 participants