DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: david.marchand@redhat.com, honnappa.nagarahalli@arm.com,
	konstantin.v.ananyev@yandex.ru, bruce.richardson@intel.com,
	mattias.ronnblom@ericsson.com, dev@dpdk.org,
	olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru,
	dev@dpdk.org
Subject: Re: [PATCH] clarify purpose of empty cache lines
Date: Thu, 12 Oct 2023 01:43:44 +0200	[thread overview]
Message-ID: <6554142.G0QQBjFxQf@thomas> (raw)
In-Reply-To: <20230904084349.12044-1-mb@smartsharesystems.com>

04/09/2023 10:43, Morten Brørup:
>  /** Force minimum cache line alignment. */
>  #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
>  
> +#define _RTE_CACHE_GUARD_HELPER2(unique) \
> +		char cache_guard_ ## unique[RTE_CACHE_LINE_SIZE * RTE_CACHE_GUARD_LINES] \
> +		__rte_cache_aligned
> +#define _RTE_CACHE_GUARD_HELPER1(unique) _RTE_CACHE_GUARD_HELPER2(unique)

What is the reason for this intermediate helper macro?

> +/**
> + * Empty cache lines, to guard against false sharing-like effects
> + * on systems with a next-N-lines hardware prefetcher.
> + *
> + * Use as spacing between data accessed by different lcores,
> + * to prevent cache thrashing on hardware with speculative prefetching.
> + */
> +#define RTE_CACHE_GUARD _RTE_CACHE_GUARD_HELPER1(__COUNTER__)





  parent reply	other threads:[~2023-10-11 23:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04  8:43 Morten Brørup
2023-09-04  9:12 ` Bruce Richardson
2023-10-11 15:59   ` Thomas Monjalon
2023-09-05  6:41 ` Morten Brørup
2023-10-11 23:43 ` Thomas Monjalon [this message]
2023-10-12  6:00   ` Morten Brørup
2023-10-12  6:07   ` Morten Brørup

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=6554142.G0QQBjFxQf@thomas \
    --to=thomas@monjalon.net \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=mb@smartsharesystems.com \
    --cc=olivier.matz@6wind.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).