[dpdk-dev] [PATCH v4 1/7] malloc: introduce malloc is ready API
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Wed Oct 20 00:04:03 CEST 2021
2021-10-20 01:01 (UTC+0300), Dmitry Kozlyuk:
> 2021-10-20 00:05 (UTC+0530), Harman Kalra:
> [...]
> > static unsigned
> > check_hugepage_sz(unsigned flags, uint64_t hugepage_sz)
> > {
> > @@ -1328,6 +1330,7 @@ rte_eal_malloc_heap_init(void)
> > {
> > struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
> > unsigned int i;
> > + int ret;
> > const struct internal_config *internal_conf =
> > eal_get_internal_configuration();
> >
> > @@ -1369,5 +1372,16 @@ rte_eal_malloc_heap_init(void)
> > return 0;
>
> A secondary process exits here...
>
> > /* add all IOVA-contiguous areas to the heap */
> > - return rte_memseg_contig_walk(malloc_add_seg, NULL);
> > + ret = rte_memseg_contig_walk(malloc_add_seg, NULL);
> > +
> > + if (ret == 0)
> > + malloc_ready = true;
>
> ...and never knows that malloc is ready.
> But malloc is always ready for a secondary process.
That is, before returning 0 above for a secondary process
malloc_ready should be set unconditionally.
More information about the dev
mailing list