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 E3E8941E38; Thu, 9 Mar 2023 10:17:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8122D40ED7; Thu, 9 Mar 2023 10:17:22 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 752A7400D7 for ; Thu, 9 Mar 2023 10:17:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678353441; 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=iJWBzbp1qgp43Z5dExMbuE8cpx47QnWMW90gWpG/qxk=; b=a+7xRXz6OjW6sDhrkHkul/ot2KElGqxndBt3MC8tWvJfoFz0kFV8EYqFFBSElHIoCGDtLE gx7FbJnic19PD7IYfbdm9bfFazuRU+gxjn74EC2i0sBBgCBSEKWbUYTdaMIt5bMD+FHoyR RD1ZD2unSiIjLtEubjrwvi03r6Zqtwo= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-T_KbN9G2O5a2B3KU5NOT8g-1; Thu, 09 Mar 2023 04:17:19 -0500 X-MC-Unique: T_KbN9G2O5a2B3KU5NOT8g-1 Received: by mail-pf1-f197.google.com with SMTP id i7-20020a626d07000000b005d29737db06so912184pfc.15 for ; Thu, 09 Mar 2023 01:17:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678353438; 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=iJWBzbp1qgp43Z5dExMbuE8cpx47QnWMW90gWpG/qxk=; b=E458Xfs5BrB4pujQaKSLsUHeILB+rRlmBbWj/DJHIafOUl6DL7LCmTwmd40heRBLyP nI6e5oNVWSEWoQfKj+wCx1NzbnzG4bfJrp+NKsWiAoo2MWny7h9vfN4bDCLyxiL41mxF 99rFB1stJi2ko+wq3iNjJ+PuP/AR4kxzXKWB0xwzYa+NQyj6PY2evnG4e1mhV75v84Ma 1YmfsaTqoItGyYboO8i/zPe4NticT3r2oZ/96/DfLlGS+K7Wun7B4Ut/0sWktdSHdDVi 4YOL2JN7NFJdF5OM65XT/tUcwRHq0nvLgDjs5umaDho50qLCp97xM99AvOvGck09XhRs DtZQ== X-Gm-Message-State: AO0yUKWy9IexlPSPJctsREPPygXSsCYZofHQ2joVApxthILVc0Ssu+LI SuVWCMaVe44xfT+EogpCN+cQU2VrRKm5uVOgxX99IEzI7FnXvSFEcCzutmqgeUYOydf+pJTcBnX lwn6yHQz+zZCEFnjkSKw= X-Received: by 2002:a17:90a:7bc6:b0:22c:2048:794e with SMTP id d6-20020a17090a7bc600b0022c2048794emr7681286pjl.7.1678353438315; Thu, 09 Mar 2023 01:17:18 -0800 (PST) X-Google-Smtp-Source: AK7set8d89/SkB05x5BUCN9WCm1hUfTWwJ1xpFa3Nam6IVEZ1JUl64rSI4Rq9FQHQ6FLDoJSEHhFwHN8yF+RskbeP5k= X-Received: by 2002:a17:90a:7bc6:b0:22c:2048:794e with SMTP id d6-20020a17090a7bc600b0022c2048794emr7681280pjl.7.1678353438000; Thu, 09 Mar 2023 01:17:18 -0800 (PST) MIME-Version: 1.0 References: <1677782682-27200-1-git-send-email-roretzla@linux.microsoft.com> In-Reply-To: From: David Marchand Date: Thu, 9 Mar 2023 10:17:06 +0100 Message-ID: Subject: Re: [PATCH 1/2] eal: fix failure race and behavior of thread create To: Tyler Retzlaff Cc: dev@dpdk.org, stable@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Mar 7, 2023 at 3:33=E2=80=AFPM David Marchand wrote: > On Thu, Mar 2, 2023 at 7:44=E2=80=AFPM Tyler Retzlaff > wrote: > > > > 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 both of the above issues by using the pthread_setaffinity_np > > prior to thread creation to set the affinity of the created thread. By > > doing this no failure paths exist after pthread_create returns > > successfully. > > > > Fixes: ce6e911d20f6 ("eal: add thread lifetime API") > > Cc: stable@dpdk.org > > Cc: roretzla@linux.microsoft.com > > > > Signed-off-by: Tyler Retzlaff > Reviewed-by: David Marchand Series applied, thanks. --=20 David Marchand