From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 1E93745C29;
	Sat,  2 Nov 2024 11:09:42 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 0F0FD4026C;
	Sat,  2 Nov 2024 11:09:42 +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 05DE34026B
 for <dev@dpdk.org>; Sat,  2 Nov 2024 11:09:39 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1730542179;
 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=7Lno8JMW3FowXOBcnvqCPe90dY9vMbh+UXNa499Ddo0=;
 b=WKc9JBBpdCovYBRnUwh7GbPiYVZVD64P2IM3Y7D13OEt51CGdgHJI+ex6vPP8Ku9+Gf3HM
 Y9FJF8f5hugw/akuK8LDkE940uYNvV1hWFxNuMgoJMQlFXzWok4qnlgrwjAUPdCBInqsik
 bHugfE7cUQ/hfm4gQ4kA4jFO6HUyhfM=
Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com
 [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-562-9vqLmFo0NRehAVOxO6LLxQ-1; Sat, 02 Nov 2024 06:09:31 -0400
X-MC-Unique: 9vqLmFo0NRehAVOxO6LLxQ-1
Received: by mail-lj1-f200.google.com with SMTP id
 38308e7fff4ca-2fb6261384aso17534481fa.0
 for <dev@dpdk.org>; Sat, 02 Nov 2024 03:09:31 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1730542166; x=1731146966;
 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=7Lno8JMW3FowXOBcnvqCPe90dY9vMbh+UXNa499Ddo0=;
 b=Z3p9zQ40mCf4zrxQEhq79DorJzoUGJwlrp/ynHhWYMViEVQrRC2hEA0PE2yIIscFgg
 4vG5A7IXfDweT5RGX+yFGV4eiEpJkQenqKgYKyTUxbbJ5nIpbCo01xY+zVncOPk5hgeC
 lRUbtpVq86o3IABIZqHwtOSJsJsTSjdIxfOdpCqjSHoOOjSAnNuPKiKAk4PfVzmSdKI7
 Z1KgpSpH+WCPI3ODKw8+LjmDJakVLuDqo5BjNuQKYwajIki3FHMrMHBwyZhvhcj9NYBt
 i93AoCh0aITmWQe38O7SQGQGcL4HyXzNKjNapsh2LkEF9IEiAuo4iarRw3EEVxcij08W
 2abw==
X-Forwarded-Encrypted: i=1;
 AJvYcCV6QyWXS44nDRNAk3ab3mU8AiNtcRUv+cTwPqfu8L+Gkx26lRL8u2r+9ZxgHbjfQd9ej3c=@dpdk.org
X-Gm-Message-State: AOJu0YzaCBEFjWB/6Vfl56P14ezqNN6jfHEy5GV14zuhZllfYRQmCOO/
 MZ2Y11rtJr/kuE4hSvKpVSOcEu8STpANGc7FDlwZXuBAxwEhH+nas8ROoKL7OhnoCe+MRMXS/69
 ZYCuZqdMNyBZInvAmI5NbgXBWCDKpzmxeRKweqQjwWI1Uc8x4uQ3to+KvivzoqBlvIjDz/9+w1k
 vx6+ZGBs9q8w5K7Rw=
X-Received: by 2002:a2e:4611:0:b0:2fb:556c:fe0b with SMTP id
 38308e7fff4ca-2fd05952eeemr57935621fa.26.1730542166368; 
 Sat, 02 Nov 2024 03:09:26 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IFGKnwDljC4dCi8KnFRWZdueO6evXJS68MzuqXk+F4QbpGc7NTgl5E02UTdujX8vml4zsX9wvKswErFB2qw9U4=
X-Received: by 2002:a2e:4611:0:b0:2fb:556c:fe0b with SMTP id
 38308e7fff4ca-2fd05952eeemr57935571fa.26.1730542165853; Sat, 02 Nov 2024
 03:09:25 -0700 (PDT)
MIME-Version: 1.0
References: <20241030190945.409721-1-luca.boccassi@gmail.com>
 <20241030203122.416198-1-luca.boccassi@gmail.com>
 <CAJFAV8zZuO6BYmkvDnsx5G14PFZGxSUEkvSX64ve3qW1yn+mmQ@mail.gmail.com>
 <CAJFAV8xuzPDyv3Pf-aACLKDrxSG-ABPPmLpQVXyD1CQ_-cLtdw@mail.gmail.com>
 <CAMw=ZnRZedBRWwvfkvmGSX_E5CpTeHnFXvSMa+g0jNpLRC_XQw@mail.gmail.com>
 <CAJFAV8xCd1QbfSUvV2vsB0Ni4K7tW+0UJ1TwZ8E+JTcxPoyC0g@mail.gmail.com>
 <CAMw=ZnST9pcMxVk-C_MS2M1LehNEmEcGjS+=joKcQNsZ8Pg7_w@mail.gmail.com>
 <20241031134620.39aea352@hermes.local>
In-Reply-To: <20241031134620.39aea352@hermes.local>
From: David Marchand <david.marchand@redhat.com>
Date: Sat, 2 Nov 2024 11:09:14 +0100
Message-ID: <CAJFAV8zd+ROsXVRQL2Jy1-PzzPsGofvOuvpDDC-U85q+UoPcmw@mail.gmail.com>
Subject: Re: [PATCH v2] Revert "eal/unix: fix thread creation"
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Luca Boccassi <luca.boccassi@gmail.com>, dev@dpdk.org,
 roretzla@linux.microsoft.com
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Thu, Oct 31, 2024 at 9:46=E2=80=AFPM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Thu, 31 Oct 2024 14:05:16 +0000
> Luca Boccassi <luca.boccassi@gmail.com> wrote:
>
> > On Thu, 31 Oct 2024 at 13:04, David Marchand <david.marchand@redhat.com=
> wrote:
> > >
> > > On Thu, Oct 31, 2024 at 1:58=E2=80=AFPM Luca Boccassi <luca.boccassi@=
gmail.com> wrote:
> > > >
> > > > On Thu, 31 Oct 2024 at 12:52, David Marchand <david.marchand@redhat=
.com> wrote:
> > > > >
> > > > > On Thu, Oct 31, 2024 at 1:47=E2=80=AFPM David Marchand
> > > > > <david.marchand@redhat.com> wrote:
> > > > > > Could you share a backtrace when hitting this deadlock?
> > > > >
> > > > > If the backtrace is not possible, running with
> > > > > --log-level=3Dlib.eal:debug may help.
> > > >
> > > > I cannot get backtraces. This runs via "meson test", how can that
> > > > option be passed in?
> > >
> > > # meson test -C build-debian --suite fast-tests --verbose -t 5
> > > --test-args=3D--log-level=3Dlib.eal:debug
> >
> > https://paste.debian.net/1334095/
>
> Could not repro this on Raspberry Pi 5. Main branch builds and runs

There is no deadlock at play, as far as I can see.

The mentionned commit slowed down thread instantiation (a lot, from
what the timestamps seen in the paste link).
The exact reason is not entirely clear to me, but it forced the thread
creating children threads to wait for them to start running.
Reverting this commit enhances the situation, but reintroduce a double
free (if set affinity of the created thread fails, both the parent and
the created thread will free ctx).

I sent a patch, reintroducing use of pthread_attr_setaffinity_np like
Tyler had first proposed.
Let's see what the CI think of this.


--=20
David Marchand