From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] spinlock: remove volatile qualifier
Date: Tue, 05 May 2026 09:01:43 +0200 [thread overview]
Message-ID: <3066926.2VHbPRQshP@thomas> (raw)
In-Reply-To: <20260504100239.07d48122@phoenix.local>
04/05/2026 19:02, Stephen Hemminger:
> On Mon, 4 May 2026 10:37:14 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > diff --git a/lib/eal/include/generic/rte_spinlock.h b/lib/eal/include/generic/rte_spinlock.h
> > index c907d4e45c..19c0e34f0a 100644
> > --- a/lib/eal/include/generic/rte_spinlock.h
> > +++ b/lib/eal/include/generic/rte_spinlock.h
> > @@ -197,8 +197,8 @@ rte_spinlock_trylock_tm(rte_spinlock_t *sl)
> > */
> > typedef struct {
> > rte_spinlock_t sl; /**< the actual spinlock */
> > - volatile int user; /**< core id using lock, -1 for unused */
> > - volatile int count; /**< count of time this lock has been called */
> > + int user; /**< core id using lock, -1 for unused */
> > + int count; /**< count of time this lock has been called */
>
> It might make sense to use unsigned for count, and sized types.
> I.e do you really need 32 bit values?
Such a change would need to be evaluated in a performance benchmark.
> Only in tree use of recursive spinlock in vdev code.
>
> PS: I wonder if we really need to keep the transactional memory versions of stuff.
I don't know, it's part of the API and has no maintenance cost.
next prev parent reply other threads:[~2026-05-05 7:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 8:37 [PATCH] spinlock: remove volatile qualifier Thomas Monjalon
2026-05-04 9:06 ` Thomas Monjalon
2026-05-04 9:12 ` [PATCH] spinlock: fix API comments Thomas Monjalon
2026-05-04 12:46 ` Thomas Monjalon
2026-05-04 17:02 ` [PATCH] spinlock: remove volatile qualifier Stephen Hemminger
2026-05-05 7:01 ` Thomas Monjalon [this message]
2026-05-05 13:24 ` Stephen Hemminger
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=3066926.2VHbPRQshP@thomas \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
/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