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 346A945C79 for ; Mon, 4 Nov 2024 18:12:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29632410F2; Mon, 4 Nov 2024 18:12:39 +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 B2BFD40279 for ; Mon, 4 Nov 2024 18:12:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730740357; 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=B9nd9zt6k9nIQabA2qO7/aLYviMuCP8a335VZSd5pWc=; b=JsBJOuOvhidCJR+0jjlxVQ05vqEiXbYdRLznLMIH082r7WAIp8ytHjgkIqThxms/mU0toF J9stVbj/w3mXNOAdreqBhPk2GSj3gSddOedhM5ynnHGzvN6OSf/6F2CohK/7kSyDAk/G0/ HDTzO45h2l0QYfHPxCuSh2/JeognZRM= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-d2nTVXhvMBWoWmWL2qNn-Q-1; Mon, 04 Nov 2024 12:12:35 -0500 X-MC-Unique: d2nTVXhvMBWoWmWL2qNn-Q-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2fc969f6e27so18266651fa.3 for ; Mon, 04 Nov 2024 09:12:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730740354; x=1731345154; 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=B9nd9zt6k9nIQabA2qO7/aLYviMuCP8a335VZSd5pWc=; b=B6pmp5vsw7SFTvm/CyzUtdmGRNML8sPN0HS19iOiTQT/Ki3orab2fh9a0Y3KWlTR60 JgUUXBHrDuw4t4duwoBmymzn6UhvH6mRO2OR67xdptPumgvRuJZRKEHd1pZXIyEkAfBp LEtNWy/xipFzlV0RYaxc1omwWNB1J5wOjKRep0Yj2dc7eerMO/7DDt17VJS/QIK71Ezd Bguhj5KPhONhmNEZpZsBYGf0lTW1jIw6aK32xYTActMcm1sA07KS3LLVkRX/KDT4DIJi uIjsRmW66i2jrJK1zbAeapWBGJgwHJBEU9qjICeUrlkKdp2M2+SZlUJh1Ub8dEthRREN LQpw== X-Forwarded-Encrypted: i=1; AJvYcCUM509vflpAZ8J9uu61TW5zuXuiiFtiknuO2dx7WdT79aQVPCnp07OO7zRc8mWZIr1oiZJwMgk=@dpdk.org X-Gm-Message-State: AOJu0YzI533G3UzPmDBOOFjIA1kNmGPkCDavzPDjCiirWBU72jjUQymW ony/jHdSSvLCubRZTDoS1rU5MoLSs4/XxPOsfJ1u5oY4WbCXsrXfHenqw3jLqB7cVIFOQCprCfl F85pKEto8esuyOG2XUuUDv7CBHw6n53P5ajIAB9xufTuy6TGZDlFsEWVcsqES4JwYu3mQEjiSWN Ya7cKC/yeYkzjiUeXrQAU= X-Received: by 2002:a05:651c:160f:b0:2fb:527a:815b with SMTP id 38308e7fff4ca-2fef435588cmr23419511fa.28.1730740353628; Mon, 04 Nov 2024 09:12:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvyAu4teNiNAS5LQueDVb5WUy2PmcIy7hz0nxzjgnIfCohkQko2gl63ZJAiLgzkEIUwXDcuR4BVAgBaXqe3Pw= X-Received: by 2002:a05:651c:160f:b0:2fb:527a:815b with SMTP id 38308e7fff4ca-2fef435588cmr23419301fa.28.1730740353208; Mon, 04 Nov 2024 09:12:33 -0800 (PST) MIME-Version: 1.0 References: <20241102100839.2325651-1-david.marchand@redhat.com> <20241104085708.3596816-1-david.marchand@redhat.com> In-Reply-To: <20241104085708.3596816-1-david.marchand@redhat.com> From: David Marchand Date: Mon, 4 Nov 2024 18:12:22 +0100 Message-ID: Subject: Re: [PATCH v4] eal/unix: optimize thread creation To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, stephen@networkplumber.org, luca.boccassi@gmail.com, stable@dpdk.org, Luca Boccassi , Chengwen Feng , Tyler Retzlaff 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 Mon, Nov 4, 2024 at 9:57=E2=80=AFAM David Marchand wrote: > > Setting the cpu affinity of the child thread from the parent thread is > racy when using pthread_setaffinity_np, as the child thread may start > running and initialize before affinity is set. > > On the other hand, setting the cpu affinity from the child thread itself > may fail, so the parent thread waits for the child thread to report > whether this call succeeded. > > This synchronisation point resulted in a significant slow down of > rte_thread_create() (as seen in the lcores_autotest unit tests, in OBS > for some ARM systems). > > Another option for setting cpu affinity is to use the not portable > pthread_attr_setaffinity_np available in FreeBSD and glibc, > but not available in musl. > > Fixes: b28c6196b132 ("eal/unix: fix thread creation") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand > Acked-by: Luca Boccassi > Acked-by: Stephen Hemminger > Acked-by: Chengwen Feng CI looks good, and I tested manually in FreeBSD and ARM+OBS. Applied, thanks. --=20 David Marchand