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 BBFBEA0553; Sat, 11 Jun 2022 03:55:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5291540222; Sat, 11 Jun 2022 03:55:04 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 2B7FC40041 for ; Sat, 11 Jun 2022 03:55:02 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LKgpl7438zjXVN; Sat, 11 Jun 2022 09:53:35 +0800 (CST) Received: from [127.0.0.1] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 11 Jun 2022 09:55:00 +0800 Subject: Re: [PATCH] doc/eal: add caveat about spinlocks from non-pinned threads To: Stephen Hemminger , CC: References: <20220610152819.38737-1-stephen@networkplumber.org> From: fengchengwen Message-ID: Date: Sat, 11 Jun 2022 09:55:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20220610152819.38737-1-stephen@networkplumber.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 2022/6/10 23:28, Stephen Hemminger wrote: > Need to warn users of DPDK spinlocks from non-pinned threads. > This is similar wording to Linux documentation in pthread_spin_init. > > Signed-off-by: Stephen Hemminger > --- > doc/guides/prog_guide/env_abstraction_layer.rst | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst > index 5f0748fba1c0..45d3de8d84f6 100644 > --- a/doc/guides/prog_guide/env_abstraction_layer.rst > +++ b/doc/guides/prog_guide/env_abstraction_layer.rst > @@ -797,6 +797,16 @@ Known Issues > > The debug statistics of rte_ring, rte_mempool and rte_timer are not supported in an unregistered non-EAL pthread. > > ++ locking > + > + If a pthread, that is not pinned to an lcore acquires a lock such as a > + DPDK based lock (rte_spinlock, rte_rwlock, rte_ticketlock, rte_mcslock) Some APIs inherently use rte_spinlock, just like rte_malloc/rte_eal_alarm_set, Because DPDK API mainly use rte_spinlock to support thread-safty. Suggest declare DPDK API mainly use rte_spinlock to support thread-safty, so if the caller thread is not pinned to an lcore may encount a possibility of large application delays. > + then there is a possibility of large application delays. > + The problem is that if a thread is scheduled off the CPU while it holds > + a lock, then other threads will waste time spinning on the lock until > + the lock holder is once more rescheduled and releases the lock. > + > + > cgroup control > ~~~~~~~~~~~~~~ > >