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 4354143C3D; Tue, 5 Mar 2024 21:50:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDED1402AC; Tue, 5 Mar 2024 21:50:32 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id A32EE402AC for ; Tue, 5 Mar 2024 21:50:30 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-29a378040daso4106816a91.1 for ; Tue, 05 Mar 2024 12:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709671829; x=1710276629; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=drkKrWEm+eXv1yeKObiu7V5EK+f3q25it9zH6L6iC78=; b=cX5HyEj2N3jVDwYf0+XMIt+FsxAXLOmNli9+g49EFDeDzIkHjN98r78dCgYxSBc9iX YfUfm3ZQ8poGDuPiYy+ZKBaFppBgD1p1cAjt0xw9AmyYNg42ma4ODqFJLKKfAKZUXOJ7 hyEasXBSllKMTLYU1RjHmOwTNMdMEk6xZckumdtg3zWlQWIbCER0ltr5Trbk5duT03t/ cF+ymciIAtwRTvQo/WPQ3K9gg4g/x/ss1uDwUGtMyTX4c1Uq/U0xKFdeUJmNmSINup9K uj0g4E6/gr0Gr+Kuxba9uqw1VOHknCAat6pOazcYyN/S2Nu8dovowiNsnGuDvyBJc5v7 lPWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709671829; x=1710276629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=drkKrWEm+eXv1yeKObiu7V5EK+f3q25it9zH6L6iC78=; b=R6Mt5C4sALpz1P2c9subRpVc/me5/u175L3mquXdBoAPF/9Bq8XqAuoVS/+SxAEwQg yBuJBypi9+xNswsYnTC6IzhrMF2MGFT/pgx59qlliqRFDvO666x3DuZauIO+0CjvMMhC QvN0AHdO0i3QJv07s1n5UZb+hpY2+p11yDiEcLd+qUw7M8WiB5wzdOcFad48V85fv7bN +hJB09exJBOtRW1ys4LVZUU8EUOq+ZtC/OtKzoxrq21Xd4CdLK+jbVrkztZCxxmPYQyI pCXjLjp+HQUtWjr24XuD8acIDANobVXcpuSv0QUkDr2veOSKplFRbTkQOij6aoEzpghK 9FMA== X-Gm-Message-State: AOJu0YyE9t9aJh3cJ99kSuXEOSN1fRFD4eFl8sIe6bDufZA8i12L0I6X 0jnenQLNe0BIWRJ+ZuWa9d0F9QxNNMQ9SKX7rJHIKv9QCKH66sJ+GXS4rESqNzY= X-Google-Smtp-Source: AGHT+IFM+FxfMD91XOEPwOJWeM7nF/j4o3EZb3Vi5PpEm7BUnUW4iQ+hfyZn7maapw/8aDtGcVPaCQ== X-Received: by 2002:a17:90a:c01:b0:299:39e0:98cb with SMTP id 1-20020a17090a0c0100b0029939e098cbmr10963613pjs.15.1709671829630; Tue, 05 Mar 2024 12:50:29 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id q14-20020a17090aa00e00b0029b32b85d3dsm6400468pjp.29.2024.03.05.12.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 12:50:29 -0800 (PST) Date: Tue, 5 Mar 2024 12:50:27 -0800 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: "dev@dpdk.org" , Tyler Retzlaff Subject: Re: RTE lock Message-ID: <20240305125027.7814d9a8@hermes.local> In-Reply-To: <0024db51-8b39-4aa7-969a-bde86fe1c764@lysator.liu.se> References: <0024db51-8b39-4aa7-969a-bde86fe1c764@lysator.liu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Tue, 5 Mar 2024 21:18:20 +0100 Mattias R=C3=B6nnblom wrote: > Shouldn't we have a DPDK-native mutex API, rather than using direct=20 > POSIX mutex lock calls? >=20 > There are two reasons for this, as I see it > 1) more cleanly support non-POSIX operating system (i.e., Microsoft=20 > Windows). > 2) to discourage mechanical use of spinlocks in places where a regular=20 > mutex lock is more appropriate. >=20 > I think (and hope) DPDK developers will tend to pick DPDK-native rather=20 > than other APIs as their first choice. >=20 > For locks, they go for spinlocks, even in control (non-fast=20 > path/non-packet processing) code paths (e.g., calls made by the typical=20 > non-EAL thread). >=20 > Using spinlocks to synchronize threads that may be preempted aren't=20 > great idea. Maybe a wrapper, but actually implementing mutex with flock is complicated.