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 2B60A41E96 for ; Wed, 15 Mar 2023 02:20:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 266BD4161A; Wed, 15 Mar 2023 02:20:49 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id 2B57140A7A for ; Wed, 15 Mar 2023 02:20:46 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id y2so17172262pjg.3 for ; Tue, 14 Mar 2023 18:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678843245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HvHdWrc7ayx2I8Ou0xIkLaHu/IXPCKeG/TtACVUJ7y4=; b=aWFuRswIghQMkjdHhYCkzIzY8ceTWT+yU8SiPGDoik/ubuuslDhffEOcjFr45Ww/id 33OCdPnsWYq6FPUmfRqZeWcCv4dCsgUiWd7LQnWnkHkscgw+zue42iVB0m/s07pwTVxt +nDxT0/Ycmd2ei7IHHhckeZ4tIepPpSi9a36cEg0oERb/ZGG1L7qEFRk496g6YLKR5Wz bF2OS+eZOHOrJhGr0jhxP5j34T9qfDD1QEeAp5uIou60fhpd0ES4F3xl+mEGlvUoaCn0 5sQY+ogr5g6GbfHfWamk9W2xlNvk/UejXzYXuoNtNOrxWfzpKqz4cSfsVLPDFlmINa0l 0HCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678843245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HvHdWrc7ayx2I8Ou0xIkLaHu/IXPCKeG/TtACVUJ7y4=; b=uBWeJYjWufaElJ/eSrDdWTj2euiFHJaX6tUuDmIVW2lgQvQo7RJNe18iVZO4qV8HpJ r9J28buX6fx1v2Gp2fUvpXKRmlXR4ixb16m/5UazSmaxylH4+7fYLLTLHvr4pQAadg7J JKLB0ot2pSqRDcGoa3/Qo0IPDr3az6fDuVCwwozUhmgpw3erl6N9Ryxywu5j61mK4o87 Qdyrb5MYW107w2fXZcg3DLJPjmpN4UUeiG+ABj3sqvWZZdL6ijnjUc2G0+vIJ/ZLIHTY ffvin4jyRoDd1OdtAEJb6GI0zmByAcdWkBjq+OTtVvClX5DMvt52+uOdP6Ls7KS+5qPL +w1A== X-Gm-Message-State: AO0yUKViR4SzdgpmugJZFiAFLYj4m+yEXcSDYHnjIGPz5AvjcddMsFX+ 8bUOZzlTn5/N6fw4mJjdRavQiA== X-Google-Smtp-Source: AK7set/5BN3Bv5CnTohHl+N7XWOMGcwNyZYq7z8kJHl5H1uMzgTgU3Y5DyHi2s6zgQLUJW+seo9rbg== X-Received: by 2002:a17:90b:1e12:b0:23d:3a3f:950d with SMTP id pg18-20020a17090b1e1200b0023d3a3f950dmr3618263pjb.40.1678843245181; Tue, 14 Mar 2023 18:20:45 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e34-20020a630f22000000b00507249cde91sm2081120pgl.91.2023.03.14.18.20.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 18:20:45 -0700 (PDT) Date: Tue, 14 Mar 2023 18:20:42 -0700 From: Stephen Hemminger To: Tyler Retzlaff Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, stable@dpdk.org Subject: Re: [PATCH v4 2/2] eal: fix failure path race setting new thread affinity Message-ID: <20230314182042.6001d7c3@hermes.local> In-Reply-To: <1678834239-11569-3-git-send-email-roretzla@linux.microsoft.com> References: <1677782682-27200-1-git-send-email-roretzla@linux.microsoft.com> <1678834239-11569-1-git-send-email-roretzla@linux.microsoft.com> <1678834239-11569-3-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Tue, 14 Mar 2023 15:50:39 -0700 Tyler Retzlaff wrote: > + /* Wait for the thread wrapper to initialize thread successfully */ > + while ((thread_wrapper_status = > + __atomic_load_n(&ctx->thread_wrapper_status, > + __ATOMIC_ACQUIRE)) == THREAD_WRAPPER_LAUNCHING) > + sched_yield(); Using pthread condition variable would be better, and avoid using sched_yield() which is deprecated and not guaranteed to work in cases where threads have different priority.