diff mbox series

[v5,2/2] build: add meson options of max_memseg_lists

Message ID 20211013205417.84119-3-tchaikov@gmail.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers show
Series build: add meson option of "max_memseg_lists" and "mbuf_refcnt_atomic" | expand

Checks

Context Check Description
ci/Intel-compilation warning apply issues
ci/checkpatch success coding style OK

Commit Message

Kefu Chai Oct. 13, 2021, 8:54 p.m. UTC
RTE_MAX_MEMSEG_LISTS = 128 is not enough for many-core machines, in our
case, we need to increase it to 8192. so add an option so user can
override it.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
---
 config/meson.build  | 1 +
 config/rte_config.h | 1 -
 meson_options.txt   | 2 ++
 3 files changed, 3 insertions(+), 1 deletion(-)

Comments

Bruce Richardson Oct. 14, 2021, 8:25 a.m. UTC | #1
On Thu, Oct 14, 2021 at 04:54:19AM +0800, Kefu Chai wrote:
> RTE_MAX_MEMSEG_LISTS = 128 is not enough for many-core machines, in our
> case, we need to increase it to 8192. so add an option so user can
> override it.
> 
> Signed-off-by: Kefu Chai <tchaikov@gmail.com>

This seems a very low-level option to be exposing to the user. Some
thoughts/questions:

- can you give some more detail on why you need such a massive number, 64
  times the default?
- what would be the impact of increasing the default to 8192? I assume this
  is only used in a few places in EAL, so would the memory footprint
  increase be large?
- rather than a single specified value, would an alternative be to make
  this be a computed value at config time, scaled by number of lcores (or
  number of numa nodes)?

Regards,
/Bruce
Thomas Monjalon Oct. 14, 2021, 8:29 a.m. UTC | #2
14/10/2021 10:25, Bruce Richardson:
> On Thu, Oct 14, 2021 at 04:54:19AM +0800, Kefu Chai wrote:
> > RTE_MAX_MEMSEG_LISTS = 128 is not enough for many-core machines, in our
> > case, we need to increase it to 8192. so add an option so user can
> > override it.
> > 
> > Signed-off-by: Kefu Chai <tchaikov@gmail.com>
> 
> This seems a very low-level option to be exposing to the user. Some
> thoughts/questions:
> 
> - can you give some more detail on why you need such a massive number, 64
>   times the default?
> - what would be the impact of increasing the default to 8192? I assume this
>   is only used in a few places in EAL, so would the memory footprint
>   increase be large?
> - rather than a single specified value, would an alternative be to make
>   this be a computed value at config time, scaled by number of lcores (or
>   number of numa nodes)?

+1 for these suggestions
diff mbox series

Patch

diff --git a/config/meson.build b/config/meson.build
index c90c7a0bfe..8d03dc6471 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -299,6 +299,7 @@  if dpdk_conf.get('RTE_ARCH_64')
 else # for 32-bit we need smaller reserved memory areas
     dpdk_conf.set('RTE_MAX_MEM_MB', 2048)
 endif
+dpdk_conf.set('RTE_MAX_MEMSEG_LISTS', get_option('max_memseg_lists'))
 if get_option('atomic_mbuf_ref_counts')
   dpdk_conf.set('RTE_MBUF_REFCNT_ATOMIC', true)
 endif
diff --git a/config/rte_config.h b/config/rte_config.h
index 208d916a1f..0a659f5e1a 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -29,7 +29,6 @@ 
 
 /* EAL defines */
 #define RTE_MAX_HEAPS 32
-#define RTE_MAX_MEMSEG_LISTS 128
 #define RTE_MAX_MEMSEG_PER_LIST 8192
 #define RTE_MAX_MEM_MB_PER_LIST 32768
 #define RTE_MAX_MEMSEG_PER_TYPE 32768
diff --git a/meson_options.txt b/meson_options.txt
index 222ad6d9d9..9127f8556f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -38,6 +38,8 @@  option('max_lcores', type: 'string', value: 'default', description:
        'Set maximum number of cores/threads supported by EAL; "default" is different per-arch, "detect" detects the number of cores on the build machine.')
 option('max_numa_nodes', type: 'string', value: 'default', description:
        'Set the highest NUMA node supported by EAL; "default" is different per-arch, "detect" detects the highest NUMA node on the build machine.')
+option('max_memseg_lists', type: 'integer', value: 128, description:
+       'maximum number of dynamic arrays holding memsegs')
 option('atomic_mbuf_ref_counts', type: 'boolean', value: true, description:
        'atomically access the mbuf refcnt')
 option('platform', type: 'string', value: 'native', description: