DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net,
	Bruce Richardson <bruce.richardson@intel.com>,
	 "Mcnamara, John" <john.mcnamara@intel.com>
Subject: Re: [PATCH v2 0/3] Improve lock annotations
Date: Fri, 13 Dec 2024 11:47:59 +0100	[thread overview]
Message-ID: <CAJFAV8y5qSDpT6tiKhFnVeJ=653P3vbJTCL9wii8dUh+xgsQ8Q@mail.gmail.com> (raw)
In-Reply-To: <20241212160049.1258449-1-david.marchand@redhat.com>

On Thu, Dec 12, 2024 at 5:02 PM David Marchand
<david.marchand@redhat.com> 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 >= 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 generation.
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/.


-- 
David Marchand


      parent reply	other threads:[~2024-12-13 10:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 12:53 [RFC " David Marchand
2024-12-02 12:53 ` [RFC 1/3] eal: add enhanced " David Marchand
2024-12-02 16:13   ` Stephen Hemminger
2024-12-02 12:53 ` [RFC 2/3] eal: enhance lock annotations for spinlock and seqlock David Marchand
2024-12-05  6:18   ` Mattias Rönnblom
2024-12-02 12:53 ` [RFC 3/3] eal: enhance lock annotations for rwlock David Marchand
2024-12-12 16:00 ` [PATCH v2 0/3] Improve lock annotations David Marchand
2024-12-12 16:00   ` [PATCH v2 1/3] eal: add enhanced " David Marchand
2024-12-12 16:00   ` [PATCH v2 2/3] eal: enhance lock annotations for spinlock and seqlock David Marchand
2024-12-12 16:00   ` [PATCH v2 3/3] eal: enhance lock annotations for rwlock David Marchand
2024-12-13 10:47   ` David Marchand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8y5qSDpT6tiKhFnVeJ=653P3vbJTCL9wii8dUh+xgsQ8Q@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).