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 9538C48A91; Mon, 3 Nov 2025 20:13:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BBE840285; Mon, 3 Nov 2025 20:13:41 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 35CDE40270 for ; Mon, 3 Nov 2025 20:13:39 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9BAE92A6B; Mon, 3 Nov 2025 11:13:30 -0800 (PST) Received: from [10.122.34.113] (unknown [10.122.34.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 37BBA3F66E; Mon, 3 Nov 2025 11:13:38 -0800 (PST) Content-Type: multipart/alternative; boundary="------------MUAaQdY3fuR7Y800DDvHDrOX" Message-ID: <455ee0d1-0393-4d8c-87b6-fa038b5ac303@arm.com> Date: Mon, 3 Nov 2025 13:13:37 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] eal: correct memory ordering in MCS lock To: Stephen Hemminger , Konstantin Ananyev Cc: Honnappa Nagarahalli , Tyler Retzlaff , "dev@dpdk.org" , Ola Liljedahl , "vattunuru@marvell.com" References: <20251023184724.1759497-1-wathsala.vithanage@arm.com> <20251103090717.2d181d95@phoenix> <20251103104803.30464227@phoenix> Content-Language: en-US From: Wathsala Vithanage In-Reply-To: <20251103104803.30464227@phoenix> 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 This is a multi-part message in MIME format. --------------MUAaQdY3fuR7Y800DDvHDrOX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/3/25 12:48, Stephen Hemminger wrote: > On Mon, 3 Nov 2025 18:06:05 +0000 > Konstantin Ananyev wrote: > >>> On 11/3/25 11:07, Stephen Hemminger wrote: >>>> On Mon, 3 Nov 2025 09:12:39 -0600 >>>> Wathsala Vithanage wrote: >>>> >>>>> MCS lock is broken, it's just a matter of time it will run into a deadlock. >>>>> >>>>> drivers/dma/cnxk is a user of MCS lock. >>>> I am surprised that a driver would use mcslock. >>>> MCSlock is targeted at case of large number of CPU's with lots of contention. >>>> It will likely be slower than spinlock or ticketlock for the use case of driver. >>> It appears in |drivers/dma/cnxk/cnxk_dmadev_fp.c|, perhaps the >>> maintainer can clarify. >>> >> If MCS lock is really broken, it needs to be fixed anyway. >> It might be used by other third-party libs/apps that do use on DPDK. > 100% agree it must be fixed. > It would be good to have test or static analysis tool that could validate all the lock types. Looked at seqlock; it seems correct. Herd7 has been useful, but it's not a static analysis tool. It requires identifying a trouble spot manually and then writing a litmus test to test the hypothesis. --------------MUAaQdY3fuR7Y800DDvHDrOX Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 11/3/25 12:48, Stephen Hemminger wrote:
On Mon, 3 Nov 2025 18:06:05 +0000
Konstantin Ananyev <konstantin.ananyev@huawei.com> wrote:

On 11/3/25 11:07, Stephen Hemminger wrote:  
On Mon, 3 Nov 2025 09:12:39 -0600
Wathsala Vithanage <wathsala.vithanage@arm.com> wrote:
 
MCS lock is broken, it's just a matter of time it will run into a deadlock.

drivers/dma/cnxk is a user of MCS lock.  
I am surprised that a driver would use mcslock.
MCSlock is targeted at case of large number of CPU's with lots of contention.
It will likely be slower than spinlock or ticketlock for the use case of driver.  
It appears in |drivers/dma/cnxk/cnxk_dmadev_fp.c|, perhaps the
maintainer can clarify.
  
If MCS lock is really broken, it needs to be fixed anyway.
It might be used by other third-party libs/apps that do use on DPDK.
100% agree it must be fixed.
It would be good to have test or static analysis tool that could validate all the lock types.
 
Looked at seqlock; it seems correct.

Herd7 has been useful, but it's not a static analysis tool. It requires identifying a trouble
spot manually and then writing a litmus test to test the hypothesis.

--------------MUAaQdY3fuR7Y800DDvHDrOX--