From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A8E54545A; Fri, 14 Jun 2024 12:28:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 165A9402DD; Fri, 14 Jun 2024 12:28:51 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3D7B2402D3 for ; Fri, 14 Jun 2024 12:28:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718360929; 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=q530hhUvlLl8XtCBj99AszYTD4biWUFk4Wf3P1DmHuo=; b=VRqU4pMP8vdT0i10/kjNRd1JEdvtt6Cjzgar9mkUmJLw2fzxo+xWs8CJawRkVM8MmxVqX6 ZQ/zCH01M4OKryQKv3dzPtDfbuWl+V9SSZi/ZBOAIdaEIbqXY7Evbv6bW8Xj/pXk+kpoDP AtEnp5zQLf2STD2eLkUmDJVYBP1gpPw= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-467-7-9NdgCYPS2aKfeiNJjkLQ-1; Fri, 14 Jun 2024 06:28:48 -0400 X-MC-Unique: 7-9NdgCYPS2aKfeiNJjkLQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2ebd5d5e151so14719071fa.2 for ; Fri, 14 Jun 2024 03:28:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718360927; x=1718965727; 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=q530hhUvlLl8XtCBj99AszYTD4biWUFk4Wf3P1DmHuo=; b=H6OUSVn4RHSaU6xBNovdQnSIZMijT+7ytxIT3C7wBf/Q3EcWE4EXuJyXW7EAze3mJU 44z+Q+ouiNzR0A+N4dIB/gPWISY3XFNhKFxjcBq3gh9ON5FUgGLxRf1lHdZ6BnzvXvde MaAlKXE2S8wGhIuN2LY33/iCS1rC9EukO3qRS6FHG+8hNz+a2faAsoHKU1HY/bVzag/8 BPo4SCv+UTJICy4Wlf6cNbbrhrjPMUsTm9uHhUjXRLQpGgx0bfocrzxpDUjfU2pFdGyl 2zXTqMHzCffgAIZeidvRsmDzrHzpoL6JckBhwzRsxdhdX18Ja/125RA9gGtZyglFu+g7 /Usg== X-Gm-Message-State: AOJu0YwzOpjVrGByjGGw3kNPwCO+p+ItLKlR+q/C68EE5uC6K6XwgFzH ZzCAfUwTrQB1Pxii3eTflN3+9Sr1FBbLAuvPrmEggt3XrPJcw9T9noI2Ay7QTNRWw9n75ZUIZn7 r5ozf/ZEX7lbUNlUFWO3vdJyTVgY7thuQdvnKtSY8rkTBdAX5Dtzw+05PC7yOmU1ezVEptWtwXn XEcUlgfdKFeFIVVmCbMZNk07E= X-Received: by 2002:a2e:86c5:0:b0:2eb:e258:7197 with SMTP id 38308e7fff4ca-2ec0e5d1865mr16289381fa.31.1718360927020; Fri, 14 Jun 2024 03:28:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbk3L+lSOu07IT7gziH91PXaWjEJ25x5agqW1rZ9YZSyGjfDEPjfqYsI3/yoUk1H2lpt/fyrD/oYCAbt5k1hQ= X-Received: by 2002:a2e:86c5:0:b0:2eb:e258:7197 with SMTP id 38308e7fff4ca-2ec0e5d1865mr16289241fa.31.1718360926635; Fri, 14 Jun 2024 03:28:46 -0700 (PDT) MIME-Version: 1.0 References: <20230927150854.3670391-1-paul.szczepanek@arm.com> <20240611125947.511243-1-paul.szczepanek@arm.com> In-Reply-To: <20240611125947.511243-1-paul.szczepanek@arm.com> From: David Marchand Date: Fri, 14 Jun 2024 12:28:34 +0200 Message-ID: Subject: Re: [PATCH v15 0/6] add pointer compression API To: Paul Szczepanek Cc: dev@dpdk.org, Honnappa Nagarahalli , =?UTF-8?Q?Morten_Br=C3=B8rup?= , Konstantin Ananyev , Bruce Richardson , Thomas Monjalon 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Jun 11, 2024 at 3:00=E2=80=AFPM Paul Szczepanek wrote: > > This patchset is proposing adding a new header only library > with utility functions that allow compression of arrays of pointers. > > Since this is a header only library a patch needed to be added to amend > the build system to allow adding libraries without source files. > > When passing caches full of pointers between threads, memory containing > the pointers is copied multiple times which is especially costly between > cores. A compression method will allow us to shrink the memory size > copied. > > The compression takes advantage of the fact that pointers are usually > located in a limited memory region. We can compress them by converting th= em > 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. The API is > very generic and does not assume mempool pointers, any pointer can be > passed in. > > Compression is based on few and fast operations and especially with vecto= r > instructions leveraged creates minimal overhead. > > The API accepts and returns arrays because the overhead means it only is > worth it when done in bulk. > > Test is added that shows potential performance gain from compression. In > this test an array of pointers is passed through a ring between two cores= . > It shows the gain which is dependent on the bulk operation size. In this > synthetic test run on ampere altra a substantial (up to 25%) performance > gain is seen if done in bulk size larger than 32. At 32 it breaks even an= d > lower sizes create a small (less than 5%) slowdown due to overhead. > > In a more realistic mock application running the l3 forwarding dpdk > example that works in pipeline mode on two cores this translated into a > ~5% throughput increase on an ampere altra. > > Paul Szczepanek (6): > lib: allow libraries with no sources > mempool: add functions to get extra mempool info > ptr_compress: add pointer compression library > test: add pointer compress tests to ring perf test > docs: add pointer compression guide > test: add unit test for ptr compression > > MAINTAINERS | 6 + > app/test/meson.build | 21 +- > app/test/test_mempool.c | 70 ++++ > app/test/test_ptr_compress.c | 193 +++++++++++ > app/test/test_ring.h | 94 ++++++ > app/test/test_ring_perf.c | 352 ++++++++++++++------- > doc/api/doxy-api-index.md | 1 + > doc/api/doxy-api.conf.in | 1 + > doc/guides/prog_guide/index.rst | 1 + > doc/guides/prog_guide/ptr_compress_lib.rst | 160 ++++++++++ > doc/guides/rel_notes/release_24_07.rst | 7 + > lib/mempool/rte_mempool.c | 45 +++ > lib/mempool/rte_mempool.h | 49 +++ > lib/mempool/version.map | 3 + > lib/meson.build | 17 + > lib/ptr_compress/meson.build | 4 + > lib/ptr_compress/rte_ptr_compress.h | 325 +++++++++++++++++++ > 17 files changed, 1217 insertions(+), 132 deletions(-) > create mode 100644 app/test/test_ptr_compress.c > create mode 100644 doc/guides/prog_guide/ptr_compress_lib.rst > create mode 100644 lib/ptr_compress/meson.build > create mode 100644 lib/ptr_compress/rte_ptr_compress.h I reorganised the series, adjusted the documentation and added some release notes for mempool, as agreed offlist. Even if this library only contains a header, with no tie to other public DPDK API, this library should be optional. If no objection, please work on this change for -rc2, Series applied, thanks Paul. --=20 David Marchand