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

pthread_detach after pthread_setaffinity_np #8852

Merged
merged 5 commits into from Nov 6, 2023

Commits on Nov 6, 2023

  1. Revert "Do not use pthread_setaffinity_np on s390x"

    This reverts commit de82439.
    mame committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    a9237a6 View commit details
    Browse the repository at this point in the history
  2. Detach a pthread after pthread_setaffinity_np

    After a pthread for getaddrinfo is detached, we cannot predict when the
    thread will exit. It would lead to a segfault by setting
    pthread_setaffinity to the terminated pthread.  I guess this problem
    would be more likely to occur in high-load environments.
    
    This change detaches the pthread after pthread_setaffinity is called.
    [Feature #19965]
    mame committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    a180889 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c4aaaaf View commit details
    Browse the repository at this point in the history
  4. Fix a memory leak

    pointed by @nobu
    mame committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    bfa9b40 View commit details
    Browse the repository at this point in the history
  5. Prevent cpu_set_t overflow even if there are more than 63 cores

    Do not use `pthread_attr_setaffinity_np` if `sched_getcpu()` exceeds
    `CPU_SETSIZE`. (Using `CPU_ALLOC()` would be more appropriate.)
    mame committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    8004ab3 View commit details
    Browse the repository at this point in the history