All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, "Bruce Richardson" <bruce.richardson@intel.com>,
	"David Hunt" <david.hunt@intel.com>,
	"Honnappa Nagarahalli" <honnappa.nagarahalli@arm.com>,
	"Jerin Jacob" <jerinj@marvell.com>,
	"Konstantin Ananyev" <konstantin.v.ananyev@yandex.ru>,
	"Sameh Gobriel" <sameh.gobriel@intel.com>,
	"Sunil Kumar Kori" <skori@marvell.com>,
	"Vladimir Medvedkin" <vladimir.medvedkin@intel.com>,
	"Yipeng Wang" <yipeng1.wang@intel.com>,
	david.marchand@redhat.com,
	"Morten Brørup" <mb@smartsharesystems.com>
Subject: Re: [PATCH 0/5] use rte atomic thread fence
Date: Wed, 14 Feb 2024 23:40:27 +0100	[thread overview]
Message-ID: <15453844.RDIVbhacDa@thomas> (raw)
In-Reply-To: <20231108184922.GB21615@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>

08/11/2023 19:49, Tyler Retzlaff:
> On Wed, Nov 08, 2023 at 06:04:47PM +0100, Thomas Monjalon wrote:
> > 02/11/2023 04:04, Tyler Retzlaff:
> > > Replace use of __atomic_thread_fence with __rte_atomic_thread_fence.
> > > 
> > > It may be appropriate to use rte_atomic_thread_fence instead but it
> > > will be up to maintainers to evaluate and make the change if appropriate.
> > 
> > I don't understand the use of __rte_atomic_thread_fence
> > which is supposed to be EAL-internal only, isn't it?
> > 
> > On x86, we have this:
> > static __rte_always_inline void
> > rte_atomic_thread_fence(rte_memory_order memorder)
> > {
> >     if (memorder == rte_memory_order_seq_cst)
> >         rte_smp_mb();
> >     else
> >         __rte_atomic_thread_fence(memorder);
> > }
> > 
> > This is skipped if you use __rte_atomic_thread_fence() directly.
> 
> correct. that is on purpose because the original code was skipping
> condition by using __atomic_thread_fence directly.

There is chance that it was not skipping on purpose.

> this series intends no functional change which is why the replacements
> are __rte_atomic_thread_fence instead of to rte_atomic_thread_fence.

We should take this opportunity to simplify the code,
I mean we should avoid having 3 functions for the same thing.

> i would encourage the maintainers to evaluate whether the code can use
> rte_atomic_thread_fence directly without functional regression.

Let's do the change so the maintainers can review what is changed.
Note it should have no impact if not using rte_memory_order_seq_cst.
If we discover later that something is broken, we have time to fix it.

Note: lib/eal/include/rte_mcslock.h should not use __rte_atomic_thread_fence()
and lib/lpm/rte_lpm.c should not use __atomic_thread_fence().

Can we replace and discourage all occurrences of
__atomic_thread_fence() and __rte_atomic_thread_fence()?
It would be simpler to recommend only rte_atomic_thread_fence().

Also in another patch, it would be nice to replace __ATOMIC_*
with rte_memory_order_*, at least when used in rte_atomic_thread_fence().



  reply	other threads:[~2024-02-14 22:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  3:04 [PATCH 0/5] use rte atomic thread fence Tyler Retzlaff
2023-11-02  3:04 ` [PATCH 1/5] distributor: " Tyler Retzlaff
2023-11-02  3:04 ` [PATCH 2/5] eal: " Tyler Retzlaff
2023-11-02  3:04 ` [PATCH 3/5] hash: " Tyler Retzlaff
2023-11-02  3:04 ` [PATCH 4/5] ring: " Tyler Retzlaff
2023-11-02  3:04 ` [PATCH 5/5] stack: " Tyler Retzlaff
2023-11-02  7:42 ` [PATCH 0/5] " Morten Brørup
2023-11-08 17:04 ` Thomas Monjalon
2023-11-08 18:49   ` Tyler Retzlaff
2024-02-14 22:40     ` Thomas Monjalon [this message]
2024-02-15  6:50 ` [PATCH v2 0/6] " Tyler Retzlaff
2024-02-15  6:50   ` [PATCH v2 1/6] distributor: " Tyler Retzlaff
2024-02-15  6:50   ` [PATCH v2 2/6] eal: " Tyler Retzlaff
2024-02-15  6:50   ` [PATCH v2 3/6] hash: " Tyler Retzlaff
2024-02-15  6:50   ` [PATCH v2 4/6] ring: " Tyler Retzlaff
2024-02-15  6:50   ` [PATCH v2 5/6] stack: " Tyler Retzlaff
2024-02-15  6:50   ` [PATCH v2 6/6] lpm: " Tyler Retzlaff
2024-02-18  3:23   ` [PATCH v2 0/6] " fengchengwen
2024-02-18 12:18     ` Thomas Monjalon

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=15453844.RDIVbhacDa@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.hunt@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=jerinj@marvell.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=mb@smartsharesystems.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=sameh.gobriel@intel.com \
    --cc=skori@marvell.com \
    --cc=vladimir.medvedkin@intel.com \
    --cc=yipeng1.wang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.