mbox

[v5,0/2] fix race in rte_thread_create failure path

Message ID 1678925224-2706-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
Headers

Message

Tyler Retzlaff March 16, 2023, 12:07 a.m. UTC
  v5:
  * refactor patch to use pthread_cond_t to wait for thread start
    wrapper to complete work.
  * rename some variables to group those that are part of the
    wrapper synchronization.
  * use stack instead of heap allocation for thread start context.

v4:
  * style fixes reported by CI

v3:
  * don't free wrapper context from new thread now that wrapper
    completion is complete before returning from creating thread.

v2:
  * new approach over v1 of the patch to avoid using pthread np API that
    is not available on Alpine Linux.
  * to conform to rte_thread_create parameter const qualification include
    an additional patch to const qualify rte_thread_set_affinity cpusetp
    parameter.

Tyler Retzlaff (2):
  eal: make cpusetp to rte thread set affinity const
  eal: fix failure path race setting new thread affinity

 lib/eal/common/eal_common_thread.c |  6 ++--
 lib/eal/include/rte_thread.h       |  2 +-
 lib/eal/unix/rte_thread.c          | 70 +++++++++++++++++++++++---------------
 3 files changed, 47 insertions(+), 31 deletions(-)