Skip to content

Defer lcore variables allocation

David Marchand dpdk-dev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 2 repliesIn review
  2. v25 patches 7 repliesSuperseded
  3. v13 patches 19 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5eal: check lcore variable handlelib/eal/include/rte_lcore_var.h+2 -00 replies
2/5random: defer seeding to EAL initlib/eal/common/eal_private.h lib/eal/common/rte_random.c lib/eal/freebsd/eal.c +2 more+21 -30 replies
3/5power: defer lcore variable allocationlib/power/rte_power_pmd_mgmt.c+19 -80 replies
4/5power: reduce memory footprint of per-lcore statelib/power/rte_power_pmd_mgmt.c+1 -10 replies
5/5eal/x86: defer power intrinsics variable allocationlib/eal/x86/rte_power_intrinsics.c+13 -20 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchAnatoly BurakovFrode NordahlMattias RönnblomChengwen Feng
SeriesSeries-acked-by
1/5A-b A-b
2/5A-b A-b R-b
3/5A-b A-b
4/5A-b A-b
5/5A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/5] Defer lcore variables allocation

As I had reported in 24.11-rc2, the lcore variables allocation have a noticeable impact on applications consuming DPDK, even when such applications does not use DPDK, or use features associated to some lcore variables.

While the amount has been reduced in a rush before rc2, there are still cases when the increased memory footprint is noticed like in scaling tests.
See https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/2090931

lcore variable allocations in constructor is a bad idea, as the application consuming DPDK has no control over such allocation:
linking some code does not mean that all of it will be used at runtime.

The general question on whether lcore variables in constructor should be forbidden, is left to a later discussion.

For now, this series only focus on fixing subsystems using lcore variables so that those allocations are deferred either in rte_eal_init() or in the path that does require such lcore variables.

Signature · 30 lines
David Marchand

Changes since v2:
- added assert in rte_s?rand(),

Changes since v1:
- added a check on lcore handle,
- fixed lcore variable size in lib/power,
- renamed/introduced allocation helpers,


David Marchand (5):
  eal: check lcore variable handle
  random: defer seeding to EAL init
  power: defer lcore variable allocation
  power: reduce memory footprint of per-lcore state
  eal/x86: defer power intrinsics variable allocation

 lib/eal/common/eal_private.h       |  6 ++++++
 lib/eal/common/rte_random.c        | 12 +++++++++---
 lib/eal/freebsd/eal.c              |  2 ++
 lib/eal/include/rte_lcore_var.h    |  2 ++
 lib/eal/linux/eal.c                |  2 ++
 lib/eal/windows/eal.c              |  2 ++
 lib/eal/x86/rte_power_intrinsics.c | 15 +++++++++++++--
 lib/power/rte_power_pmd_mgmt.c     | 29 ++++++++++++++++++++---------
 8 files changed, 56 insertions(+), 14 deletions(-)

-- 
2.48.1