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

Fix the return value of Concurrent.available_processor_count when cpu.cfs_quota_us is -1 #1060

Merged

Commits on Aug 10, 2024

  1. Fix the return value of Concurrent.available_processor_count when `…

    …cpu.cfs_quota_us` is -1
    
    I tried to use `Concurrent.available_processor_count` in `parallel`
    gem, but we got some feedback `Concurrent.available_processor_count`
    returned a negative value.
    grosser/parallel#348 (comment)
    grosser/parallel#349 (comment)
    
    According to the https://docs.kernel.org/scheduler/sched-bwc.html#management,
    The default value of `cpu.cfs_quota_us` is -1. In that case,
    cgroup does not adhere to any CPU time restrictions.
    
    This PR adds the case of `cpu.cfs_quota_us` is -1 to `#cpu_quota`
    to return processor count from `Concurrent.available_processor_count`
    in that case.
    y-yagi committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    7fea31d View commit details
    Browse the repository at this point in the history