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 5E98045B7C; Fri, 13 Dec 2024 11:48:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DCDB4066A; Fri, 13 Dec 2024 11:48:15 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1839A40669 for ; Fri, 13 Dec 2024 11:48:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734086893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tMCpWBkXZSknkDVJyhuQtOBqF+A5g9I6s21QVVT+Kgk=; b=UFsChVjzKqsI0Fn6+WrWXR9xBpgz6ndPuA8pE2HpI9nhF2k5N9E278vpeNOeUp94hzWUEY rG71OkobJZT3FKl+OvYeL1IikY36Vi2MzjviFtId/PjUOfD9VtuuIOZ6B097LVjHLt2u+w rjhOlrLRzmevtyFqLwR+UqDMQKMBOds= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-vvmpSzNwOV2mLEqolkouhw-1; Fri, 13 Dec 2024 05:48:12 -0500 X-MC-Unique: vvmpSzNwOV2mLEqolkouhw-1 X-Mimecast-MFC-AGG-ID: vvmpSzNwOV2mLEqolkouhw Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-3021a3abd07so8384061fa.3 for ; Fri, 13 Dec 2024 02:48:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734086890; x=1734691690; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tMCpWBkXZSknkDVJyhuQtOBqF+A5g9I6s21QVVT+Kgk=; b=LHZGaDu+8e/owISm/o6XKtf/wr33YJmNFfNpQm221GAbD6koHlxnPxl2TGVBXrWdbD u/zSDQ6/6MyE0mPI8vQ9p0h88/pPrDj9rETkmJcgYvKMpDT6rHaMG/tX/EWO0f2wv6gE zQJzA92NiSB10bb2pU3izQql+kxEizwaGxHgmAwvizxCIcdTNhVX6r9QP2LXVy4eZ4Me bdls6xTy4YOu3vx5fOx7t36KGjuDMf0enqhYYbpYuJnLhaL4kd8pjUnm1KalIhMFjBJT OnzqD5Q9pWa7Y0Fp/dOJinaRuqbAnd1OWbgUGZlAeI1uu/mVVwETjGfd1VO7kj7DRv/2 jgGA== X-Gm-Message-State: AOJu0Yy0j7XVSiJ+jSQmFFKz4pBp16JrNHLRzNjHnvlN01S5z+7W7eiH oiNrDxVvbBJFY9qbB8aCpFCo5BJ1tYs3kqykdcVwIlfn0UYeXFcZ5QJooApCW5vOcTouoYrQ+Xj TlulppVtZZjh4H7W1dtuT3+Vl6QGR1ShNWxRCRh31gmRS10EGOQNGOCBP2gi0ADRjR+Uh8V5Dpo uZnxki9sepdXezgYyjqn3Tj7ik9Nxu X-Gm-Gg: ASbGnctZEdZ1zh4Yn7EpkK5+wOvKK8DCL2JXe71yWU9jfPJkVwezqMs/+RzSEz10dw7 Td+U4klkDe+B7TnZWsrlnq3+WvQKnoWEWyUGKU6FW X-Received: by 2002:a2e:be0e:0:b0:302:18fa:3bec with SMTP id 38308e7fff4ca-302544ab7d9mr8293341fa.32.1734086890559; Fri, 13 Dec 2024 02:48:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGe0YB+5bP2DCcJweI7yuVNv4rY5EX1g4gX5dbs2AOWkevxWn8AiZylplmH1z5G874kwaxLDxWF7RYAGFycq58= X-Received: by 2002:a2e:be0e:0:b0:302:18fa:3bec with SMTP id 38308e7fff4ca-302544ab7d9mr8293171fa.32.1734086890194; Fri, 13 Dec 2024 02:48:10 -0800 (PST) MIME-Version: 1.0 References: <20241202125316.3732529-1-david.marchand@redhat.com> <20241212160049.1258449-1-david.marchand@redhat.com> In-Reply-To: <20241212160049.1258449-1-david.marchand@redhat.com> From: David Marchand Date: Fri, 13 Dec 2024 11:47:59 +0100 Message-ID: Subject: Re: [PATCH v2 0/3] Improve lock annotations To: dev@dpdk.org Cc: thomas@monjalon.net, Bruce Richardson , "Mcnamara, John" X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: CZnDHBo7KZP9FhnnpXQgsTJcGDYjyJRYoQEzwNLY7qE_1734086891 X-Mimecast-Originator: redhat.com 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 Thu, Dec 12, 2024 at 5:02=E2=80=AFPM David Marchand wrote: > > A recent bug (see 22aa9a9c7099 ("vhost: fix deadlock in Rx async path")) > made more visible a gap in the clang thread safety annotations that > DPDK uses: no distinction is made between releasing a read lock and > releasing a write lock. > > Clang 3.6 and later offers improved thread safety checks. > > Marking objects as "lockable" has evolved into flagging some named > "capability". clang reports the capability name when an error is > reported (making this report a bit easier to understand). > > For example, a spinlock is now flagged as: > typedef struct __rte_capability("spinlock") { > volatile RTE_ATOMIC(int) locked; > } rte_spinlock_t; > > > For "exclusive" locking (spinlocks / write locks), the conversion is: > - exclusive_lock_function -> acquire_capability > - exclusive_trylock_function -> try_acquire_capability > - unlock_function -> release_capability > ... > > For "shared" locking (read locks): > - shared_lock_function -> acquire_shared_capability > - shared_trylock_function -> try_acquire_shared_capability > - unlock_function -> release_shared_capability > ... > > > This series proposes to use those annotations (sticking to the > convention of simply prefixing the compiler attributes with __rte_). > The existing "old" annotations macros are left in place in case users > started to rely on them. > > Note: DPDK requirements state that clang version must be >=3D 3.6 > (following use of C11 standard). > > Comments welcome. Just a note on Intel CI report. http://mails.dpdk.org/archives/test-report/2024-December/834120.html (As reported a few times), this CI reports an error on documentation genera= tion. I can't be sure but this failure here is most likely due to this CI filtering out of the patches any update on doc/. --=20 David Marchand