DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mattias Rönnblom" <hofors@lysator.liu.se>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Jerin Jacob <jerinj@marvell.com>
Subject: Re: [RFC PATCH] eventdev: ensure 16-byte alignment for events
Date: Fri, 6 Oct 2023 14:29:57 +0200	[thread overview]
Message-ID: <188898b5-3182-4b0e-a294-e79873a65633@lysator.liu.se> (raw)
In-Reply-To: <ZR/7buT5KgDV0ecv@bricha3-MOBL.ger.corp.intel.com>

On 2023-10-06 14:19, Bruce Richardson wrote:
> On Fri, Oct 06, 2023 at 02:15:00PM +0200, Mattias Rönnblom wrote:
>> On 2023-10-05 13:51, Bruce Richardson wrote:
>>> The event structure in DPDK is 16-bytes in size, and events are
>>> regularly passed as parameters directly rather than being passed as
>>> pointers.
>>
>> When are events passed by-value, rather than by-reference? There are no such
>> examples in the public eventdev API.
>>
>> To help compiler optimize correctly, we can explicitly request
>>> 16-byte alignment for events, which means that we should be able
>>> to do aligned vector loads/stores (e.g. with SSE or Neon) when working
>>> with those events.
>>>
>>
>> That change is both helping and sabotaging the optimizer's work. Now every
>> stack allocation needs to be 2-byte aligned - in DPDK code, and in the
>> application. >>
>> The effect this change has on an eventdev app using DSW is a ~3 cycle/event
>> performance degradation on an AMD Zen 3 system, and a ~4 cycle/event
>> performance degradation on a Skylake-generation Intel CPU.
>>
> 
> Thanks for checking - this is the sort of feedback needed alright. In SW
> eventdev we copy events around alot without using pointers, so I felt that
> alignment would be helpful to avoid issues with events spanning cachelines.
> 
> However, since it has negative impacts, I'm quite happy to drop the idea,
> and keep things as they are. I'll mark the change as rejected in patchwork.
> 

I think this was an excellent idea, it just didn't happen to have the 
desired effect. At least not in the particular cases where I evaluated it.

Given the complexity of compilers and CPUs, it's almost impossible to 
predict the outcome, performance-wise, of a particular change.

  reply	other threads:[~2023-10-06 12:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 11:51 Bruce Richardson
2023-10-05 12:06 ` Bruce Richardson
2023-10-05 13:11   ` Jerin Jacob
2023-10-05 13:15     ` Bruce Richardson
2023-10-06  7:19       ` Jerin Jacob
2023-10-05 12:12 ` Morten Brørup
2023-10-05 13:02   ` Bruce Richardson
2023-10-06  9:37 ` [PATCH v2] " Bruce Richardson
2023-10-06  9:45 ` [PATCH v3] " Bruce Richardson
2023-10-06 10:13   ` Morten Brørup
2023-10-06 10:16     ` Jerin Jacob
2023-10-06 10:19       ` Bruce Richardson
2023-10-06 10:24         ` Jerin Jacob
2023-10-06 10:27           ` Bruce Richardson
2023-10-06 10:16     ` Bruce Richardson
2023-10-06 10:35       ` Morten Brørup
2023-10-06 10:44         ` Bruce Richardson
2023-10-06 10:29 ` [PATCH v4] " Bruce Richardson
2023-11-12  0:01   ` Stephen Hemminger
2023-11-12  8:30     ` Morten Brørup
2023-11-12 23:31       ` Stephen Hemminger
2023-11-13  7:58         ` Morten Brørup
2024-01-19 21:05           ` Tyler Retzlaff
2023-10-06 12:15 ` [RFC PATCH] " Mattias Rönnblom
2023-10-06 12:19   ` Bruce Richardson
2023-10-06 12:29     ` Mattias Rönnblom [this message]
2024-01-19 22:30   ` 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=188898b5-3182-4b0e-a294-e79873a65633@lysator.liu.se \
    --to=hofors@lysator.liu.se \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.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;
as well as URLs for NNTP newsgroup(s).