DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Konstantin Ananyev" <konstantin.v.ananyev@yandex.ru>,
	"Wathsala Vithanage" <wathsala.vithanage@arm.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Cc: David Marchand <david.marchand@redhat.com>
Subject: RE: [PATCH] ring: add cache guard after ring elements table
Date: Tue, 5 May 2026 07:47:05 +0000	[thread overview]
Message-ID: <70a4b0baa49448d0b93d2088319afaf5@huawei.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35F65842@smartserver.smartshare.dk>



> > > > > Added cache guard after the table holding the ring elements, to
> > avoid
> > > > > false sharing conflicts caused by next-line hardware prefetchers
> > when
> > > > > accessing elements at the end of the ring table.
> > > >
> > > > I don't see any harm with it, and in theory it might help in some
> > > > cases...
> > > > Though I wonder how real is that problem?
> > > > Did you ever observe such contention to happen?
> > >
> > > I never observed a problem with this.
> > > The risk of contention depends on what is allocated in the memory
> > after the ring.
> > > Which is application specific.
> > >
> > > It seems like a purely theoretical issue, but should be fixed anyway,
> > to eliminate
> > > that risk.
> >
> > Ok, as I said I see no harm with it.
> > Should we document this change somewhere? RN or PG?
> 
> We don't want the release notes overflowing with minor details.
> IMO, this change is below the threshold for what people might care about.
> People interested in the detailed changes between releases should read the git
> log.

I still think we do need document somewhere why we doing it.
If you think RN or PG is not the right place, let's just put it as a comment for that particular function.

> Also, I don't think it's worth backporting, because I consider it unlikely to have
> any real effect.
> In the context of backporting, it could be considered a performance
> improvement rather than a bug fix.

I don't see much point to backport it.

> 
> > Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> >
> > > >
> > > > > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> > > > > ---
> > > > >  lib/ring/rte_ring.c | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > >
> > > > > diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
> > > > > index f10050a1c4..9ccc62cd42 100644
> > > > > --- a/lib/ring/rte_ring.c
> > > > > +++ b/lib/ring/rte_ring.c
> > > > > @@ -73,8 +73,11 @@ rte_ring_get_memsize_elem(unsigned int esize,
> > > > unsigned
> > > > > int count)
> > > > >  		return -EINVAL;
> > > > >  	}
> > > > >
> > > > > +	static_assert(sizeof(struct rte_ring) ==
> > > > > RTE_CACHE_LINE_ROUNDUP(sizeof(struct rte_ring)),
> > > > > +			"Size of struct rte_ring not cache line
> > aligned");
> > > > >  	sz = sizeof(struct rte_ring) + (ssize_t)count * esize;
> > > > >  	sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
> > > > > +	sz += RTE_CACHE_GUARD_LINES * RTE_CACHE_LINE_SIZE;
> > > > >  	return sz;
> > > > >  }
> > > > >
> > > > > --
> > > > > 2.43.0


  reply	other threads:[~2026-05-05  7:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 10:23 [PATCH] ring: add cache guard after ring elements table Morten Brørup
2026-04-21 17:04 ` Morten Brørup
2026-04-30 17:22 ` Konstantin Ananyev
2026-04-30 18:34   ` Morten Brørup
2026-05-04 12:55     ` Konstantin Ananyev
2026-05-04 13:17       ` Morten Brørup
2026-05-05  7:47         ` Konstantin Ananyev [this message]
2026-05-05  8:18           ` Morten Brørup
2026-05-05  9:05             ` Konstantin Ananyev
2026-05-05 16:13 ` [PATCH v2] " Morten Brørup
2026-05-06  1:04   ` fengchengwen
2026-05-11 23:29   ` Wathsala Vithanage

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=70a4b0baa49448d0b93d2088319afaf5@huawei.com \
    --to=konstantin.ananyev@huawei.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=mb@smartsharesystems.com \
    --cc=stable@dpdk.org \
    --cc=wathsala.vithanage@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
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