On Thu, 15 Apr 2021 08:42:39 +0100 Ferruh Yigit <ferruh.yi...@intel.com> wrote:
> > (If I understand correctly, mlx PMD level now should support multi-process, > > but better to have the confirmation from maintainers with much deeper > > level). > > I assume this patch solves the posix mutex for multi-process only, hard to > > say the flow API primary/secondary process safe after that patch. > > > > I am also not quite sure how PMDs that doesn't require mutex at all, (mlx5, > bnxt, sfc) behave on multi process. Is calling flow APIs from both > primary/secondary safe? > > >> > >> > >> Stephen, > >> Are you aware of any downside setting 'PTHREAD_PROCESS_SHARED' attribute > >> to the > >> mutex? Any possible performance implications? > >> Only impacts the contended case. Setting the PROCESS_SHARED turns the mutex causes the mutex to behave differently when cmxchg fails. Internally pthread_mutex_lock will call futex if it has to wait and the SHARED flag impacts whether FUTEX_PRIVATE_FLAG is set. FUTEX_PRIVATE_FLAG (since Linux 2.6.22) This option bit can be employed with all futex operations. It tells the kernel that the futex is process-private and not shared with another process (i.e., it is being used for synchro‐ nization only between threads of the same process). This allows the kernel to make some additional performance optimizations.