From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Olivier MATZ <olivier.matz@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 1/4] eal: Introduce new cache macro definitions
Date: Wed, 6 Jan 2016 20:40:46 +0530 [thread overview]
Message-ID: <20160106151032.GA20958@localhost.localdomain> (raw)
In-Reply-To: <568A7089.3070506@6wind.com>
On Mon, Jan 04, 2016 at 02:15:53PM +0100, Olivier MATZ wrote:
> Hi Jerin,
Hi Olivier,
>
> Please see some comments below.
>
> On 12/14/2015 05:32 AM, Jerin Jacob wrote:
> > - RTE_CACHE_MIN_LINE_SIZE(Supported minimum cache line size)
> > - __rte_cache_min_aligned(Force minimum cache line alignment)
> > - RTE_CACHE_LINE_SIZE_LOG2(Express cache line size in terms of log2)
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > ---
> > lib/librte_eal/common/include/rte_memory.h | 16 ++++++++++++++++
> > 1 file changed, 16 insertions(+)
> >
> > diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
> > index 9c9e40f..b67a76f 100644
> > --- a/lib/librte_eal/common/include/rte_memory.h
> > +++ b/lib/librte_eal/common/include/rte_memory.h
> > @@ -77,11 +77,27 @@ enum rte_page_sizes {
> > (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / RTE_CACHE_LINE_SIZE))
> > /**< Return the first cache-aligned value greater or equal to size. */
> >
> > +/**< Cache line size in terms of log2 */
> > +#if RTE_CACHE_LINE_SIZE == 64
> > +#define RTE_CACHE_LINE_SIZE_LOG2 6
> > +#elif RTE_CACHE_LINE_SIZE == 128
> > +#define RTE_CACHE_LINE_SIZE_LOG2 7
> > +#else
> > +#error "Unsupported cache line size"
> > +#endif
> > +
> > +#define RTE_CACHE_MIN_LINE_SIZE 64 /**< Minimum Cache line size. */
> > +
>
> I think RTE_CACHE_LINE_MIN_SIZE or RTE_MIN_CACHE_LINE_SIZE would
> be clearer than RTE_CACHE_MIN_LINE_SIZE.
OK. I will resend the next version with RTE_CACHE_LINE_MIN_SIZE
>
> > /**
> > * Force alignment to cache line.
> > */
> > #define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE)
> >
> > +/**
> > + * Force minimum cache line alignment.
> > + */
> > +#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_MIN_LINE_SIZE)
>
> I'm not really convinced that __rte_cache_min_aligned is straightforward
> for someone reading the code that it means "aligned to the minimum cache
> line size supported by the dpdk".
>
> In the two cases you are using this macro (mbuf structure and queue
> info), I'm wondering if using __attribute__((aligned(64))) wouldn't be
> clearer?
> - for mbuf, it could be a local define, like MBUF_ALIGN_SIZE
> - for queue info, using 64 makes sense as it's used to reserve space
> for future use
>
> What do you think?
IMO, it makes sense to keep "__rte_cache_min_aligned" as it will useful
for forcing the minimum alignment requirements in DPDK in future
structures.
Thoughts?
>
>
> Regards,
> Olivier
next prev parent reply other threads:[~2016-01-06 15:11 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-06 15:59 [dpdk-dev] [PATCH 0/2] fix performance/cache resource issues with 128-byte cache line targets Jerin Jacob
2015-12-06 15:59 ` [dpdk-dev] [PATCH 1/2] mbuf: fix performance/cache resource issue " Jerin Jacob
2015-12-07 15:21 ` Ananyev, Konstantin
2015-12-08 12:45 ` Jerin Jacob
2015-12-08 16:07 ` Ananyev, Konstantin
2015-12-08 17:49 ` Jerin Jacob
2015-12-09 13:44 ` Ananyev, Konstantin
2015-12-09 14:49 ` Jerin Jacob
2015-12-06 15:59 ` [dpdk-dev] [PATCH 2/2] bitmap: optimize for 128-bytes " Jerin Jacob
2015-12-06 16:30 ` [dpdk-dev] [PATCH 0/2] fix performance/cache resource issues with 128-byte " Thomas Monjalon
2015-12-07 7:26 ` Jerin Jacob
2015-12-07 11:40 ` Thomas Monjalon
2015-12-07 14:33 ` Jerin Jacob
2015-12-07 14:35 ` Thomas Monjalon
2015-12-10 16:36 ` [dpdk-dev] [PATCH v2 0/4] " Jerin Jacob
2015-12-10 16:36 ` [dpdk-dev] [PATCH v2 1/4] eal: Introduce new cache macro definitions Jerin Jacob
2015-12-10 16:36 ` [dpdk-dev] [PATCH v2 2/4] mbuf: fix performance/cache resource issue with 128-byte cache line targets Jerin Jacob
2015-12-10 16:36 ` [dpdk-dev] [PATCH v2 3/4] bitmap: optimize for 128-bytes " Jerin Jacob
2015-12-10 16:36 ` [dpdk-dev] [PATCH v2 4/4] cache/slow-path: reduce cache align requirement for 128-byte cache targets Jerin Jacob
2015-12-11 12:55 ` Ananyev, Konstantin
2015-12-11 13:07 ` Thomas Monjalon
2015-12-11 13:56 ` Jerin Jacob
2015-12-11 14:42 ` Ananyev, Konstantin
2015-12-14 4:32 ` [dpdk-dev] [PATCH v3 0/4] fix performance/cache resource issues with 128-byte cache line targets Jerin Jacob
2015-12-14 4:32 ` [dpdk-dev] [PATCH v3 1/4] eal: Introduce new cache macro definitions Jerin Jacob
2016-01-04 13:15 ` Olivier MATZ
2016-01-06 15:10 ` Jerin Jacob [this message]
2015-12-14 4:32 ` [dpdk-dev] [PATCH v3 2/4] mbuf: fix performance/cache resource issue with 128-byte cache line targets Jerin Jacob
2015-12-14 4:32 ` [dpdk-dev] [PATCH v3 3/4] bitmap: optimize for 128-bytes " Jerin Jacob
2015-12-14 4:32 ` [dpdk-dev] [PATCH v3 4/4] cache/slow-path: reduce cache align requirement for 128-byte cache targets Jerin Jacob
2016-01-29 7:45 ` [dpdk-dev] [PATCH v4 0/4] fix performance/cache resource issues with 128-byte cache line targets Jerin Jacob
2016-01-29 7:45 ` [dpdk-dev] [PATCH v4 1/4] eal: Introduce new cache line macro definitions Jerin Jacob
2016-01-29 7:45 ` [dpdk-dev] [PATCH v4 2/4] mbuf: fix performance/cache resource issue with 128-byte cache line targets Jerin Jacob
2016-01-29 7:45 ` [dpdk-dev] [PATCH v4 3/4] bitmap: optimize for 128-bytes " Jerin Jacob
2016-01-29 7:45 ` [dpdk-dev] [PATCH v4 4/4] cache/slow-path: reduce cache align requirement for 128-byte cache targets Jerin Jacob
2016-02-08 9:31 ` [dpdk-dev] [PATCH v4 0/4] fix performance/cache resource issues with 128-byte cache line targets Jerin Jacob
2016-02-08 10:24 ` Jan Viktorin
2016-02-08 10:52 ` Jerin Jacob
2016-02-08 12:56 ` Jan Viktorin
2016-02-11 11:53 ` Thomas Monjalon
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=20160106151032.GA20958@localhost.localdomain \
--to=jerin.jacob@caviumnetworks.com \
--cc=dev@dpdk.org \
--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).