From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF366C54E41 for ; Tue, 5 Mar 2024 20:18:24 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0970B402B2; Tue, 5 Mar 2024 21:18:24 +0100 (CET) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 11F89402AC for ; Tue, 5 Mar 2024 21:18:22 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id C3A99FA05 for ; Tue, 5 Mar 2024 21:18:21 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id B766EFA04; Tue, 5 Mar 2024 21:18:21 +0100 (CET) Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 97213FA03; Tue, 5 Mar 2024 21:18:20 +0100 (CET) Message-ID: <0024db51-8b39-4aa7-969a-bde86fe1c764@lysator.liu.se> Date: Tue, 5 Mar 2024 21:18:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "dev@dpdk.org" Cc: Tyler Retzlaff From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Subject: RTE lock 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 Shouldn't we have a DPDK-native mutex API, rather than using direct POSIX mutex lock calls? There are two reasons for this, as I see it 1) more cleanly support non-POSIX operating system (i.e., Microsoft Windows). 2) to discourage mechanical use of spinlocks in places where a regular mutex lock is more appropriate. I think (and hope) DPDK developers will tend to pick DPDK-native rather than other APIs as their first choice. For locks, they go for spinlocks, even in control (non-fast path/non-packet processing) code paths (e.g., calls made by the typical non-EAL thread). Using spinlocks to synchronize threads that may be preempted aren't great idea.