From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id AFBEC43BBA;
	Thu,  7 Mar 2024 12:22:51 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 92B394067E;
	Thu,  7 Mar 2024 12:22:51 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by mails.dpdk.org (Postfix) with ESMTP id 0F82A40272
 for <dev@dpdk.org>; Thu,  7 Mar 2024 12:22:49 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1709810569;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=5Gz++jJtrR8UzT/Xn6QBG7+8sulFn4Gp4Mll2p+ZXGQ=;
 b=i1c6XuG0By4PIYiq7lc1ePiL1ujCal0R7qVKCABAiJpUuDd+ij1AX2X4R9cdZ/Kn8q9ycM
 u37n1auquj49sOkHLXiJg84597lLtSkKbJM/15POLOiV0quI1goUxqXNiPUU7MIywtbAwe
 Z+xLaa+MJOLjuaCMjDoVbu3AyZKZwDM=
Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com
 [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-392-w0THP_fDOLCjv64bVl4nyA-1; Thu, 07 Mar 2024 06:22:48 -0500
X-MC-Unique: w0THP_fDOLCjv64bVl4nyA-1
Received: by mail-lj1-f197.google.com with SMTP id
 38308e7fff4ca-2d2fe83c377so5573091fa.0
 for <dev@dpdk.org>; Thu, 07 Mar 2024 03:22:47 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1709810566; x=1710415366;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=5Gz++jJtrR8UzT/Xn6QBG7+8sulFn4Gp4Mll2p+ZXGQ=;
 b=nPo1aEYusvLmIF1nMe2/gz9z+XetDEe1H3W5Jw44Ak88Hj+mYy2leDOWHDcF4S2lAk
 jb74TklbLt3fIeNGDthKOZmUMQtfdRw9tSvrKGFrfez5klNmDsFeYuoEr0BqPoz2jgUt
 qhOL/uXR02IT3WETIOqJiR1EZu/+CVmgaAw7a4HorsY+PBkP8nFutnzZsHl3NSpMagvG
 7ehqzSfoBUgYBirQFURk0NoRdxmdGY2ZJdebP//6wcqNFWEvdKK1pYf5VmAUcAUJy8Pk
 mXwttgp/setwIcPpOeG5CsF33TCViogOxp3yVAn7RzQUrWpV3NcJdFk2nwXk06PFQkgf
 UI2w==
X-Gm-Message-State: AOJu0YyCTMU4ii5wI5rMn8W3To79leUA8Xf+TnQGIo53yg3pRaNJUeA6
 KZJ+vVSSk5FK696k21vmMjZaeDxPIqEVJY97K21pZgdLTrT96qe2AoyY3XvUOvfVYux6BGB9Ikz
 XlbJvzrzh2rACgo72P2TEF43uE0zssCFzRowgYDkpjUwoIwfNa4Ej8IJPkObrzwhIa5v5LReRM7
 IZIEL/aCj/0B0emFQ=
X-Received: by 2002:a05:6512:1388:b0:512:ee09:a7a5 with SMTP id
 fc8-20020a056512138800b00512ee09a7a5mr1623834lfb.34.1709810566617; 
 Thu, 07 Mar 2024 03:22:46 -0800 (PST)
X-Google-Smtp-Source: AGHT+IEwnwaUbE/1xWo92AWX0gME6lMXhrGeBdAID9Jg2Q4fRcUQc6D4oLrjT9gCN6eJfrmaGC5UZloHXEHQeIrwgI0=
X-Received: by 2002:a05:6512:1388:b0:512:ee09:a7a5 with SMTP id
 fc8-20020a056512138800b00512ee09a7a5mr1623817lfb.34.1709810566275; Thu, 07
 Mar 2024 03:22:46 -0800 (PST)
MIME-Version: 1.0
References: <20230927150854.3670391-2-paul.szczepanek@arm.com>
 <20240301102104.20074-1-paul.szczepanek@arm.com>
 <20240301102104.20074-2-paul.szczepanek@arm.com>
In-Reply-To: <20240301102104.20074-2-paul.szczepanek@arm.com>
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 7 Mar 2024 12:22:34 +0100
Message-ID: <CAJFAV8wucL_9WYG3SsbULjNv5pZE=DvEyiVM-3EYHOV_j7dYzA@mail.gmail.com>
Subject: Re: [PATCH v7 1/4] eal: add pointer compression functions
To: Paul Szczepanek <paul.szczepanek@arm.com>
Cc: dev@dpdk.org, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, 
 Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Hello Paul,

Before sending the v8, please fix small issues I found.


On Fri, Mar 1, 2024 at 11:21=E2=80=AFAM Paul Szczepanek <paul.szczepanek@ar=
m.com> wrote:
>
> Add a new utility header for compressing pointers. The provided
> functions can store pointers in 32-bit offsets.
>
> The compression takes advantage of the fact that pointers are
> usually located in a limited memory region (like a mempool).
> We can compress them by converting them to offsets from a base
> memory address. Offsets can be stored in fewer bytes (dictated
> by the memory region size and alignment of the pointer).
> For example: an 8 byte aligned pointer which is part of a 32GB
> memory pool can be stored in 4 bytes.
>
> This can be used for example when passing caches full of pointers
> between threads. Memory containing the pointers is copied multiple
> times which is especially costly between cores. This compression
> method will allow us to shrink the memory size copied. Further
> commits add a test to evaluate the effectiveness of this approach.
>
> Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Signed-off-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  lib/eal/include/meson.build        |   1 +
>  lib/eal/include/rte_ptr_compress.h | 266 +++++++++++++++++++++++++++++
>  2 files changed, 267 insertions(+)
>  create mode 100644 lib/eal/include/rte_ptr_compress.h
>
> diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build
> index e94b056d46..ce2c733633 100644
> --- a/lib/eal/include/meson.build
> +++ b/lib/eal/include/meson.build
> @@ -36,6 +36,7 @@ headers +=3D files(
>          'rte_pci_dev_features.h',
>          'rte_per_lcore.h',
>          'rte_pflock.h',
> +       'rte_ptr_compress.h',

I suppose it will not be applicable in v8 but:

$ ./devtools/check-meson.py
Error parsing lib/eal/include/meson.build:38, got some tabulation
Error: Incorrect indent at lib/eal/include/meson.build:39


>          'rte_random.h',
>          'rte_reciprocal.h',
>          'rte_seqcount.h',
> diff --git a/lib/eal/include/rte_ptr_compress.h b/lib/eal/include/rte_ptr=
_compress.h
> new file mode 100644
> index 0000000000..47a72e4213
> --- /dev/null
> +++ b/lib/eal/include/rte_ptr_compress.h
> @@ -0,0 +1,266 @@
> +/* SPDX-License-Identifier: BSD-shift-Clause

Not sure what the "shift" license is.
Typo?

DPDK uses BSD-3-Clause license.

> + * Copyright(c) 2023 Arm Limited

Should be 2024 now.

> + */
> +
> +#ifndef RTE_PTR_COMPRESS_H
> +#define RTE_PTR_COMPRESS_H

For the rest, I'll trust reviewers.


--=20
David Marchand