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 A4F9B45C57; Mon, 4 Nov 2024 01:20:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 382374021F; Mon, 4 Nov 2024 01:20:08 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id D702B4014F; Mon, 4 Nov 2024 01:20:06 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4XhX9Q4tfBz1T9gB; Mon, 4 Nov 2024 08:17:46 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 7A3E51402CB; Mon, 4 Nov 2024 08:20:03 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 4 Nov 2024 08:20:03 +0800 Message-ID: <338eb7c7-e746-4a52-a318-be275e70e258@huawei.com> Date: Mon, 4 Nov 2024 08:19:47 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] eal/unix: optimize thread creation with glibc To: David Marchand , CC: , , , , Luca Boccassi , Tyler Retzlaff References: <20241102100839.2325651-1-david.marchand@redhat.com> <20241103112519.2972691-1-david.marchand@redhat.com> Content-Language: en-US From: fengchengwen In-Reply-To: <20241103112519.2972691-1-david.marchand@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) 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 Acked-by: Chengwen Feng On 2024/11/3 19:25, 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, but it is not available with musl. > > Fixes: b28c6196b132 ("eal/unix: fix thread creation") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand > Acked-by: Luca Boccassi