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 7F19DA0553; Sat, 11 Jun 2022 18:41:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 264CE4021E; Sat, 11 Jun 2022 18:41:41 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id AA39F40150 for ; Sat, 11 Jun 2022 18:41:40 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id E3A5339BD for ; Sat, 11 Jun 2022 18:41:39 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E24CB3B9C; Sat, 11 Jun 2022 18:41:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED, AWL, NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.6 X-Spam-Score: -2.6 Received: from [192.168.1.59] (unknown [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 435353B0B; Sat, 11 Jun 2022 18:41:39 +0200 (CEST) Message-ID: Date: Sat, 11 Jun 2022 18:41:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] doc/eal: add caveat about spinlocks from non-pinned threads Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: anatoly.burakov@intel.com References: <20220610152819.38737-1-stephen@networkplumber.org> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= In-Reply-To: <20220610152819.38737-1-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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-06-10 17: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 > + Isn't this problem more general than locks? The use of any non-preemption safe data structures potentially causes such delays. Regular DPDK rings for sure. The lock-less stack? The hash library? Both actual and open-coded spinlocks internal to the APIs are also very common. > + 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) > + then there is a possibility of large application delays. Pinning or not doesn't matter. What matters is if the thread is preempted and thus is prevented from making progress for a long time. > + 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 > ~~~~~~~~~~~~~~ >