From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Marohn, Byron" <byron.marohn@intel.com>,
"Edupuganti, Saikrishna" <saikrishna.edupuganti@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/4] hash: reorganize bucket structure
Date: Thu, 29 Sep 2016 01:40:37 +0000 [thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8973CA00EC6@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20160928090523.GB47356@bricha3-MOBL3>
> -----Original Message-----
> From: Richardson, Bruce
> Sent: Wednesday, September 28, 2016 2:05 AM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Marohn, Byron; Edupuganti, Saikrishna
> Subject: Re: [PATCH v3 2/4] hash: reorganize bucket structure
>
> On Tue, Sep 06, 2016 at 08:34:02PM +0100, Pablo de Lara wrote:
> > From: Byron Marohn <byron.marohn@intel.com>
> >
> > Move current signatures of all entries together in the bucket
> > and same with all alternative signatures, instead of having
> > current and alternative signatures together per entry in the bucket.
> > This will be benefitial in the next commits, where a vectorized
> > comparison will be performed, achieving better performance.
> >
> > Signed-off-by: Byron Marohn <byron.marohn@intel.com>
> > Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
> > ---
> > lib/librte_hash/rte_cuckoo_hash.c | 43 ++++++++++++++++++----------------
> -
> > lib/librte_hash/rte_cuckoo_hash.h | 17 ++++----------
> > lib/librte_hash/rte_cuckoo_hash_x86.h | 20 ++++++++--------
> > 3 files changed, 37 insertions(+), 43 deletions(-)
> >
> <snip>
> > --- a/lib/librte_hash/rte_cuckoo_hash.h
> > +++ b/lib/librte_hash/rte_cuckoo_hash.h
> > @@ -151,17 +151,6 @@ struct lcore_cache {
> > void *objs[LCORE_CACHE_SIZE]; /**< Cache objects */
> > } __rte_cache_aligned;
> >
> > -/* Structure storing both primary and secondary hashes */
> > -struct rte_hash_signatures {
> > - union {
> > - struct {
> > - hash_sig_t current;
> > - hash_sig_t alt;
> > - };
> > - uint64_t sig;
> > - };
> > -};
> > -
> > /* Structure that stores key-value pair */
> > struct rte_hash_key {
> > union {
> > @@ -174,10 +163,14 @@ struct rte_hash_key {
> >
> > /** Bucket structure */
> > struct rte_hash_bucket {
> > - struct rte_hash_signatures signatures[RTE_HASH_BUCKET_ENTRIES];
> > + hash_sig_t sig_current[RTE_HASH_BUCKET_ENTRIES];
> > +
> > /* Includes dummy key index that always contains index 0 */
> > uint32_t key_idx[RTE_HASH_BUCKET_ENTRIES + 1];
> > +
> > uint8_t flag[RTE_HASH_BUCKET_ENTRIES];
> > +
> > + hash_sig_t sig_alt[RTE_HASH_BUCKET_ENTRIES];
> > } __rte_cache_aligned;
> >
>
> Is there a reason why sig_current and sig_alt fields cannot be beside each
> other in the structure. It looks strange having them separate by other fields?
Bucket entries has increased to 8 now, so sig_current and key_idx take 64 bytes
(key_idx will be reduced to 8 entries in the fourth patch).
Therefore, the idea was to push sig_alt to the next cache line
(assuming a 64 byte cacheline, if it is bigger, then either way is ok),
as it is not used in lookup (like sig_current and key_idx).
Anyway, I think I will move sig_alt before flag, so it is cache aligned,
in case vectorization is used in the future.
Thanks,
Pablo
>
> /Bruce
next prev parent reply other threads:[~2016-09-29 1:40 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 21:34 [dpdk-dev] [PATCH 0/3] Cuckoo hash lookup enhancements Pablo de Lara
2016-08-26 21:34 ` [dpdk-dev] [PATCH 1/3] hash: reorganize bucket structure Pablo de Lara
2016-08-26 21:34 ` [dpdk-dev] [PATCH 2/3] hash: add vectorized comparison Pablo de Lara
2016-08-27 8:57 ` Thomas Monjalon
2016-09-02 17:05 ` De Lara Guarch, Pablo
2016-08-26 21:34 ` [dpdk-dev] [PATCH 3/3] hash: modify lookup bulk pipeline Pablo de Lara
2016-09-02 22:56 ` [dpdk-dev] [PATCH v2 0/4] Cuckoo hash lookup enhancements Pablo de Lara
2016-09-02 22:56 ` [dpdk-dev] [PATCH v2 1/4] hash: reorder hash structure Pablo de Lara
2016-09-02 22:56 ` [dpdk-dev] [PATCH v2 2/4] hash: reorganize bucket structure Pablo de Lara
2016-09-02 22:56 ` [dpdk-dev] [PATCH v2 3/4] hash: add vectorized comparison Pablo de Lara
2016-09-02 22:56 ` [dpdk-dev] [PATCH v2 4/4] hash: modify lookup bulk pipeline Pablo de Lara
2016-09-06 19:33 ` [dpdk-dev] [PATCH v3 0/4] Cuckoo hash lookup enhancements Pablo de Lara
2016-09-30 7:38 ` [dpdk-dev] [PATCH v4 0/4] Cuckoo hash enhancements Pablo de Lara
2016-09-30 7:38 ` [dpdk-dev] [PATCH v4 1/4] hash: reorder hash structure Pablo de Lara
2016-09-30 7:38 ` [dpdk-dev] [PATCH v4 2/4] hash: reorganize bucket structure Pablo de Lara
2016-09-30 7:38 ` [dpdk-dev] [PATCH v4 3/4] hash: add vectorized comparison Pablo de Lara
2016-09-30 7:38 ` [dpdk-dev] [PATCH v4 4/4] hash: modify lookup bulk pipeline Pablo de Lara
2016-09-30 19:53 ` [dpdk-dev] [PATCH v4 0/4] Cuckoo hash enhancements Gobriel, Sameh
2016-10-03 9:59 ` Bruce Richardson
2016-10-04 6:50 ` De Lara Guarch, Pablo
2016-10-04 7:17 ` De Lara Guarch, Pablo
2016-10-04 9:47 ` Bruce Richardson
2016-10-04 23:25 ` [dpdk-dev] [PATCH v5 " Pablo de Lara
2016-10-04 23:25 ` [dpdk-dev] [PATCH v5 1/4] hash: reorder hash structure Pablo de Lara
2016-10-04 23:25 ` [dpdk-dev] [PATCH v5 2/4] hash: reorganize bucket structure Pablo de Lara
2016-10-04 23:25 ` [dpdk-dev] [PATCH v5 3/4] hash: add vectorized comparison Pablo de Lara
2016-10-04 23:25 ` [dpdk-dev] [PATCH v5 4/4] hash: modify lookup bulk pipeline Pablo de Lara
2016-10-05 10:12 ` [dpdk-dev] [PATCH v5 0/4] Cuckoo hash enhancements Thomas Monjalon
2016-09-06 19:34 ` [dpdk-dev] [PATCH v3 0/4] Cuckoo hash lookup enhancements Pablo de Lara
2016-09-06 19:34 ` [dpdk-dev] [PATCH v3 1/4] hash: reorder hash structure Pablo de Lara
2016-09-28 9:02 ` Bruce Richardson
2016-09-29 1:33 ` De Lara Guarch, Pablo
2016-09-06 19:34 ` [dpdk-dev] [PATCH v3 2/4] hash: reorganize bucket structure Pablo de Lara
2016-09-28 9:05 ` Bruce Richardson
2016-09-29 1:40 ` De Lara Guarch, Pablo [this message]
2016-09-06 19:34 ` [dpdk-dev] [PATCH v3 3/4] hash: add vectorized comparison Pablo de Lara
2016-09-06 19:34 ` [dpdk-dev] [PATCH v3 4/4] hash: modify lookup bulk pipeline Pablo de Lara
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=E115CCD9D858EF4F90C690B0DCB4D8973CA00EC6@IRSMSX108.ger.corp.intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=bruce.richardson@intel.com \
--cc=byron.marohn@intel.com \
--cc=dev@dpdk.org \
--cc=saikrishna.edupuganti@intel.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).