From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E36441EC0 for ; Sat, 18 Mar 2023 19:26:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C06A40EE1; Sat, 18 Mar 2023 19:26:25 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 91E6740ED8 for ; Sat, 18 Mar 2023 19:26:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679163983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vkhzmgQCtt5jdEgvEBJFI1o7w9Qhnolno0jNgz2RlQU=; b=ZINdh5WKFWjiBUhVAINBr2U3KUCEyg0llGh/qamKh1VMYAkCG1R4j2b5qUL6HxczZhxLG2 sfEXoAsUAo/hRhXCEyIxgBr8qcnJIhcoeJjsi4gqEVMpIS3z2z29fU6wobwDzQs5EnBlVB V7vE7X26Zg/DfEZZ+/9WUmg8jj/n4n8= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-9P3QDprdO9msH9oB7q4rXw-1; Sat, 18 Mar 2023 14:26:16 -0400 X-MC-Unique: 9P3QDprdO9msH9oB7q4rXw-1 Received: by mail-pl1-f198.google.com with SMTP id x4-20020a170902ec8400b001a1a5f6f272so3035628plg.1 for ; Sat, 18 Mar 2023 11:26:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679163975; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vkhzmgQCtt5jdEgvEBJFI1o7w9Qhnolno0jNgz2RlQU=; b=5HmVm0sBxstNcHDQSQ6eCdhgyuLo4qVE9dcxxJqt4KMeSggSOOv1oCk63X+8/L6xD/ BDwSyfHVFrYSx8ICZofU2/vwBqsxpLMRTAMyb73D3+jv9aMqkgq4VU4V0yF6z1Xw1K1e DvPm3DLwO1C0rNBWwJIm/5vCN1uJieJ50nWEX977VNDJuPjnA1a0i4mnOPnvk4C/xUob iLoQIKV1P2Rg7xEX2b4Uvqek88ct/CppVAkHX2zs8neUCh9VWi1iwCmlV5ofl0reJfvR fFfMDNxqg0kmIfkfqoZNE4ATx19MymsBH+Z9ZSy9gD0rHDN7xa3LmzJq3+PN7dq1/Mib mK5A== X-Gm-Message-State: AO0yUKXea6NTQCWsq/hlVfQ8uTpTWA8yW5rwGPIETDdyM6MfvIZh8OzK uHUZ+WxPn/b/n8IE4J8u0xfhag3lx+UN5KcpzclLXj/OrJWTPa7oIvgA0XKpCErquqyqeqwuAjR Va/JTNfVREWjbDv4l3xckLh0= X-Received: by 2002:a17:90b:108c:b0:23f:6efa:bd55 with SMTP id gj12-20020a17090b108c00b0023f6efabd55mr1124175pjb.8.1679163975598; Sat, 18 Mar 2023 11:26:15 -0700 (PDT) X-Google-Smtp-Source: AK7set9SjUHzhuy23e9E137mVeFAouNX8E0sF0SNLNM2GxtdpF9epZTsaUJOV+s5r5g5uzifvMwbqrygAXYFO27Sw+0= X-Received: by 2002:a17:90b:108c:b0:23f:6efa:bd55 with SMTP id gj12-20020a17090b108c00b0023f6efabd55mr1124173pjb.8.1679163975185; Sat, 18 Mar 2023 11:26:15 -0700 (PDT) MIME-Version: 1.0 References: <1677782682-27200-1-git-send-email-roretzla@linux.microsoft.com> <20230317185229.449011-1-david.marchand@redhat.com> <20230317212413.GB26815@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20230317212413.GB26815@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: David Marchand Date: Sat, 18 Mar 2023 19:26:03 +0100 Message-ID: Subject: Re: [PATCH v6] eal/unix: fix thread creation To: Tyler Retzlaff Cc: dev@dpdk.org, thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Narcisa Vasile , Dmitry Kozlyuk X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Fri, Mar 17, 2023 at 10:24=E2=80=AFPM Tyler Retzlaff wrote: > > On Fri, Mar 17, 2023 at 07:52:29PM +0100, David Marchand wrote: > > From: Tyler Retzlaff > > > > In rte_thread_create setting affinity after pthread_create may fail. > > Such a failure should result in the entire rte_thread_create failing > > but doesn't. > > > > Additionally if there is a failure to set affinity a race exists where > > the creating thread will free ctx and depending on scheduling of the ne= w > > thread it may also free ctx (double free). > > > > Resolve the above by setting the affinity from the newly created thread > > using a condition variable to signal the completion of the thread > > start wrapper having completed. > > > > Since we are now waiting for the thread start wrapper to complete we ca= n > > allocate the thread start wrapper context on the stack. While here clea= n > > up the variable naming in the context to better highlight the fields of > > the context require synchronization between the creating and created > > thread. > > > > Fixes: ce6e911d20f6 ("eal: add thread lifetime API") > > Cc: stable@dpdk.org > > > > Signed-off-by: Tyler Retzlaff > > Signed-off-by: David Marchand > > --- > > Looks good to me, not sure if you need a Reviewed-by: from me for the > changes but here is one anyway. > > v5 > Reviewed-by: Tyler Retzlaff Thanks for the review, I'll keep your SoB only on the patch. --=20 David Marchand