DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Steven Lariau <steven.lariau@arm.com>
Cc: Olivier Matz <olivier.matz@6wind.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "nd@arm.com" <nd@arm.com>,
	 "dharmik.thakkar@arm.com" <dharmik.thakkar@arm.com>,
	"Eads, Gage" <gage.eads@intel.com>
Subject: Re: [dpdk-dev] [PATCH 5/5] lib/stack: remove pop cas release ordering
Date: Fri, 25 Sep 2020 16:27:12 +0200
Message-ID: <CAJFAV8zPCp7qsK4Z6VuMO+t8xYTLxVEpc2VUQwM1_WT0zkV7EA@mail.gmail.com> (raw)
In-Reply-To: <SN6PR11MB25741961AE09FA5499879275F63A0@SN6PR11MB2574.namprd11.prod.outlook.com>

Hello Steven,

On Mon, Sep 21, 2020 at 7:17 PM Eads, Gage <gage.eads@intel.com> wrote:
> > -----Original Message-----
> > From: Steven Lariau <steven.lariau@arm.com>
> > Sent: Friday, September 11, 2020 10:30 AM
> > To: Eads, Gage <gage.eads@intel.com>; Olivier Matz <olivier.matz@6wind.com>
> > Cc: dev@dpdk.org; nd@arm.com; dharmik.thakkar@arm.com; Steven Lariau
> > <steven.lariau@arm.com>
> > Subject: [PATCH 5/5] lib/stack: remove pop cas release ordering
> >
> > Replace the store-release by relaxed for the CAS success at the end of
> > pop. Release isn't needed, because there is not write to data that need
> > to be synchronized.
> > The only preceding write is when the length is decreased, but the length
> > CAS loop already ensures the right synchronization.
> > The situation to avoid is when a thread sees the old length but the new
> > list, that doesn't have enough items for pop to success.
> > But the CAS success on length before the pop loop ensures any core reads
> > and updates the latest length, preventing this situation.
> >
> > The store-release is also used to make sure that the items are read
> > before the head is updated, in order to prevent a core in pop to read an
> > incorrect value because another core rewrites it with push.
> > But this isn't needed, because items are read only when removed from the
> > used list. Right after this, they are pushed to the free list, and the
> > store-release in push makes sure the items are read before they are
> > visible in the free list.
>
> Please add a comment to this effect above the compare-exchange call. Depending
> on this caller behavior for correctness is a little risky, but since this header
> is private to the library I think it's ok as long as it's well-documented.
>

Can you prepare a v2 for this comment?
Thanks.


-- 
David Marchand


  reply	other threads:[~2020-09-25 14:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 15:29 [dpdk-dev] [PATCH 0/5] lib/stack: improve lockfree C11 implementation Steven Lariau
2020-09-11 15:29 ` [dpdk-dev] [PATCH 1/5] lib/stack: fix inconsistent weak / strong cas Steven Lariau
2020-09-21 17:16   ` Eads, Gage
2020-09-11 15:29 ` [dpdk-dev] [PATCH 2/5] lib/stack: remove push acquire fence Steven Lariau
2020-09-21 17:16   ` Eads, Gage
2020-09-11 15:29 ` [dpdk-dev] [PATCH 3/5] lib/stack: remove redundant orderings for list->len Steven Lariau
2020-09-21 17:16   ` Eads, Gage
2020-09-11 15:29 ` [dpdk-dev] [PATCH 4/5] lib/stack: reload head when pop fails Steven Lariau
2020-09-21 17:16   ` Eads, Gage
2020-09-11 15:29 ` [dpdk-dev] [PATCH 5/5] lib/stack: remove pop cas release ordering Steven Lariau
2020-09-21 17:17   ` Eads, Gage
2020-09-25 14:27     ` David Marchand [this message]
2020-09-25 17:43 ` [dpdk-dev] [PATCH v2 0/5] lib/stack: improve lockfree C11 implementation Steven Lariau
2020-09-25 17:43   ` [dpdk-dev] [PATCH v2 1/5] lib/stack: fix inconsistent weak / strong cas Steven Lariau
2020-09-28 10:22     ` David Marchand
2020-09-28 15:58       ` Eads, Gage
2020-09-25 17:43   ` [dpdk-dev] [PATCH v2 2/5] lib/stack: remove push acquire fence Steven Lariau
2020-09-25 17:43   ` [dpdk-dev] [PATCH v2 3/5] lib/stack: remove redundant orderings for list->len Steven Lariau
2020-09-25 17:43   ` [dpdk-dev] [PATCH v2 4/5] lib/stack: reload head when pop fails Steven Lariau
2020-09-25 17:43   ` [dpdk-dev] [PATCH v2 5/5] lib/stack: remove pop cas release ordering Steven Lariau
2020-09-25 17:57     ` Eads, Gage
2020-09-30 19:14   ` [dpdk-dev] [PATCH v2 0/5] lib/stack: improve lockfree C11 implementation David Marchand

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=CAJFAV8zPCp7qsK4Z6VuMO+t8xYTLxVEpc2VUQwM1_WT0zkV7EA@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dharmik.thakkar@arm.com \
    --cc=gage.eads@intel.com \
    --cc=nd@arm.com \
    --cc=olivier.matz@6wind.com \
    --cc=steven.lariau@arm.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git