[dpdk-dev] [PATCH v3 1/3] ring: read tail using atomic load
Ola Liljedahl
Ola.Liljedahl at arm.com
Mon Oct 8 14:30:15 CEST 2018
On 08/10/2018, 14:21, "Jerin Jacob" <jerin.jacob at caviumnetworks.com> wrote:
-----Original Message-----
> Date: Mon, 8 Oct 2018 17:35:25 +0530
> From: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> To: Ola Liljedahl <Ola.Liljedahl at arm.com>
> CC: "dev at dpdk.org" <dev at dpdk.org>, Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>, "Ananyev, Konstantin"
> <konstantin.ananyev at intel.com>, "Gavin Hu (Arm Technology China)"
> <Gavin.Hu at arm.com>, Steve Capper <Steve.Capper at arm.com>, nd <nd at arm.com>,
> "stable at dpdk.org" <stable at dpdk.org>
> Subject: Re: [dpdk-dev] [PATCH v3 1/3] ring: read tail using atomic load
> User-Agent: Mutt/1.10.1 (2018-07-13)
>
> External Email
>
> -----Original Message-----
> > Date: Mon, 8 Oct 2018 11:59:16 +0000
> > From: Ola Liljedahl <Ola.Liljedahl at arm.com>
> > To: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> > CC: "dev at dpdk.org" <dev at dpdk.org>, Honnappa Nagarahalli
> > <Honnappa.Nagarahalli at arm.com>, "Ananyev, Konstantin"
> > <konstantin.ananyev at intel.com>, "Gavin Hu (Arm Technology China)"
> > <Gavin.Hu at arm.com>, Steve Capper <Steve.Capper at arm.com>, nd <nd at arm.com>,
> > "stable at dpdk.org" <stable at dpdk.org>
> > Subject: Re: [PATCH v3 1/3] ring: read tail using atomic load
> > user-agent: Microsoft-MacOutlook/10.11.0.180909
> >
> >
> > On 08/10/2018, 13:50, "Jerin Jacob" <jerin.jacob at caviumnetworks.com> wrote:
> >
> >
> > I don't know how that creates more undefined behavior. So replied in the
> > context of your reply that, according to your view even Linux is running
> > with undefined behavior.
> >
> > As I explained, Linux does not use C11 atomics (nor GCC __atomic builtins) so
> > cannot express the kind of undefined behaviour caused by mixing conflicting atomic
> > (as defined by the C11 standard) and non-atomic accesses to the same object.
> >
> > Checked the latest version from https://github.com/torvalds/linux
>
> Yet another top post. So you removed the complete earlier context. Never
> mind.
Top post? My reply is under your text. As is this.
Don't blame my stupid mail agent on your misunderstanding of C11.
>
> I am not saying Linux is using C11 atomic. I asked, Can't we follow
> like Linux to use the HW feature of load acquire and store release
> semantics with introducing C11 memory model.
correction:
s/with introducing C11 memory model/with out introducing C11 memory model
You can generate e.g. AArch64/A64 LDAR and STLR instructions using inline assembler.
But you won't be able to specify acquire and release ordering to the compiler, so you
must specify a full memory barrier instead.
But why create a C11-like but custom DPDK specific memory model when the compiler
already supports a standardised, well defined and tested memory model? You would just be
creating a mountain of technical debt.
>
>
>
> >
> >
More information about the dev
mailing list