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 2975841E96; Wed, 15 Mar 2023 02:20:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05B1240A7A; Wed, 15 Mar 2023 02:20:48 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 29A2B400EF for ; Wed, 15 Mar 2023 02:20:46 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id ix20so11946104plb.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=ToZwbVV0bw/JYc+wNWKbC/zhYHByQMY3bbNeQpWQAThYy+yR/a77hBH3CKz9d1DtWS WHKcF1jX/1GvLmIhbE9StZJTLdALDm5Uq4Q361T0iodQ3Y79HXJTu2wJNcr9qhNxR6yl Nz3W136r11JOVuqm6GpeO2cLhJwj+NYHuWHj2MAf9EqSGCJqgvM8yX4JeHAxefbbe+kl PTaBqPbSNJ0VO1Mg9JYelDKugOUzjRXq1Id1xc/1FNLvl3Df1CdZMxnf1Npe6pnJMda2 boIeN15m8S5qFdGrBG7haLB+cy/eGdCYZh3oZwqtukSaliNtgvFVVLrvtWtvdPkQyrUO ARKA== X-Gm-Message-State: AO0yUKVQZYMCEXZKHpMtRJfKNlsGtqQz4QbOu6wyKa31lIDzJtxMcDIB pUSjjwm1axNYL4Nm1RSuTFTogQ== 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: 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, 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.