[PATCH] eal: speed up dpdk init time

2024-05-27 Thread Fengnan Chang
hugepg_tbl by orig_va first and then just read numa_maps line by line is enough to find socket. In my test, spent time reduced to 19s. Signed-off-by: Fengnan Chang --- lib/eal/linux/eal_memory.c | 115 +++-- 1 file changed, 72 insertions(+), 43 deletions(-) diff

Re: [External] Re: [PATCH] eal: fix modify data area after memset

2023-10-30 Thread Fengnan Chang
于2023年10月26日周四 00:04写道: > On Mon, 23 Oct 2023 17:07:21 +0800 > Fengnan Chang wrote: > > > Dmitry Kozlyuk 于2023年10月23日周一 04:22写道: > > > > > > 2023-09-22 16:12 (UTC+0800), Fengnan Chang: > > > > ping > > > > > > > > Fe

Re: [External] Re: [PATCH] eal: fix modify data area after memset

2023-10-23 Thread Fengnan Chang
Dmitry Kozlyuk 于2023年10月23日周一 04:22写道: > > 2023-09-22 16:12 (UTC+0800), Fengnan Chang: > > ping > > > > Fengnan Chang 于2023年9月12日周二 17:05写道: > > > > > > Let's look at this path: > > > malloc_elem_free > > >->mal

Re: [PATCH] eal: fix modify data area after memset

2023-09-22 Thread Fengnan Chang
ping Fengnan Chang 于2023年9月12日周二 17:05写道: > > Let's look at this path: > malloc_elem_free >->malloc_elem_join_adjacent_free > ->join_elem(elem, elem->next) > > 0. cur elem's pad > 0 > 1. data area memset in malloc_elem_free first. > 2.

Re: [External] Re: [RFC PATCH] move memset out of hold lock when rte_free

2023-09-12 Thread Fengnan Chang
This problem had fix in this patch http://patches.dpdk.org/project/dpdk/patch/20230912090415.48709-1-changfeng...@bytedance.com/ I'm doing long-term test, especially rte_zmalloc. Fengnan Chang 于2023年9月12日周二 10:44写道: > > This patch still have problem, I'll fix next version. >

[PATCH] eal: fix modify data area after memset

2023-09-12 Thread Fengnan Chang
gt;size, this address had memset in step 1, it casue the content of addrees become non-zero. If user call rte_zmalloc, and pick this elem, it can't get all zero'd memory. Fixes: 2808a12cc053 (malloc: fix memory element size in case of padding) Signed-off-by: Fengnan Chang ---

Re: [External] Re: [RFC PATCH] move memset out of hold lock when rte_free

2023-09-11 Thread Fengnan Chang
This patch still have problem, I'll fix next version. Stephen Hemminger 于2023年9月6日周三 23:08写道: > > On Thu, 31 Aug 2023 19:19:37 +0800 > Fengnan Chang wrote: > > > +#ifndef RTE_MALLOC_DEBUG > > + if (internal_conf->legacy_mem) { > > + /* If or

[RFC PATCH] move memset out of hold lock when rte_free

2023-08-31 Thread Fengnan Chang
3us 627us 524277 694us 2973us 1048576 2117us 7685us Signed-off-by: Fengnan Chang --- lib/eal/common/malloc_elem.c | 16 lib/eal/common/malloc_heap.c | 26 -- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/lib/eal/common/malloc_elem.

[PATCH v3] eal: fix prompt info when remap_segment failed

2023-07-04 Thread Fengnan Chang
When there is not enough space to memsegs, we should prompt which configuration should be modified instead of printing some numbers. Signed-off-by: Fengnan Chang --- lib/eal/common/eal_common_dynmem.c | 6 ++ lib/eal/freebsd/eal_memory.c | 8 +++- lib/eal/linux/eal_memory.c

[PATCH v2] eal: fix prompt info when remap_segment failed

2023-06-15 Thread Fengnan Chang
When there is not enough space to memsegs, we should prompt which configuration should be modified instead of printing some numbers. Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal_memory.c | 5 ++--- lib/eal/linux/eal_memory.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions

Re: [External] Re: [PATCH] eal: fix prompt info when remap_segment failed

2023-06-14 Thread Fengnan Chang
Burakov, Anatoly 于2023年6月13日周二 19:00写道: > > On 5/29/2023 12:21 PM, Fengnan Chang wrote: > > when there is enough space for memseg, we should pormpt which > > config to modify, not just print numbers. > > > > Signed-off-by: Fengnan Chang > > --- > > li

Re: [External] Re: [PATCH] eal: fix prompt info when remap_segment failed

2023-06-14 Thread Fengnan Chang
David Marchand 于2023年6月12日周一 21:09写道: > > On Mon, May 29, 2023 at 1:22 PM Fengnan Chang > wrote: > > > > when there is enough space for memseg, we should pormpt which > > config to modify, not just print numbers. > > I think you want to explain the case whe

Re: [External] Re: [PATCH v4] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-06-09 Thread Fengnan Chang
David Marchand 于2023年6月8日周四 04:33写道: > > On Mon, May 29, 2023 at 1:23 PM Fengnan Chang > wrote: > > > > Under legacy mode, if the number of continuous memsegs greater > > than RTE_MAX_MEMSEG_PER_LIST, eal init will failed even though > > another memseg list is em

[PATCH] eal: fix prompt info when remap_segment failed

2023-05-29 Thread Fengnan Chang
when there is enough space for memseg, we should pormpt which config to modify, not just print numbers. Signed-off-by: Fengnan Chang --- lib/eal/linux/eal_memory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c

[PATCH v4] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-29 Thread Fengnan Chang
files into memseg lists EAL: FATAL: Cannot init memory EAL: Cannot init memory Signed-off-by: Fengnan Chang Signed-off-by: Lin Li Signed-off-by: Burakov Anatoly Reviewed-by: Anatoly Burakov --- lib/eal/linux/eal_memory.c | 51 +++--- 1 file changed, 36 inserti

Re: [External] Re: [PATCH v3] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-29 Thread Fengnan Chang
Burakov, Anatoly 于2023年5月26日周五 23:33写道: > > On 5/26/2023 3:41 PM, Burakov, Anatoly wrote: > > On 5/26/2023 4:41 AM, Fengnan Chang wrote: > >> Under legacy mode, if the number of continuous memsegs greater > >> than RTE_MAX_MEMSEG_PER_LIST, eal init will failed even t

[PATCH v3] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-25 Thread Fengnan Chang
files into memseg lists EAL: FATAL: Cannot init memory EAL: Cannot init memory Signed-off-by: Fengnan Chang Signed-off-by: Lin Li Signed-off-by: Burakov Anatoly --- lib/eal/linux/eal_memory.c | 55 +- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git

Re: [External] Re: [PATCH v2] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-25 Thread Fengnan Chang
Burakov, Anatoly 于2023年5月22日周一 21:28写道: > > On 5/22/2023 1:41 PM, Fengnan Chang wrote: > > Under legacy mode, if the number of continuous memsegs greater > > than RTE_MAX_MEMSEG_PER_LIST, eal init will failed even though > > another memseg list is empty, because only one

[PATCH v2] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-22 Thread Fengnan Chang
files into memseg lists EAL: FATAL: Cannot init memory EAL: Cannot init memory Signed-off-by: Fengnan Chang Signed-off-by: Lin Li --- lib/eal/linux/eal_memory.c | 33 + 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/eal/linux/eal_memory.c b/lib

Re: [External] Re: [PATCH] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-22 Thread Fengnan Chang
Burakov, Anatoly 于2023年5月20日周六 23:03写道: > > Hi, > > On 5/16/2023 1:21 PM, Fengnan Chang wrote: > > Under legacy mode, if the number of continuous memsegs greater > > than RTE_MAX_MEMSEG_PER_LIST, eal init will failed even though > > another memseg list is empty, bec

[PATCH] eal: fix eal init may failed when too much continuous memsegs under legacy mode

2023-05-16 Thread Fengnan Chang
remap hugepage files into memseg lists EAL: FATAL: Cannot init memory EAL: Cannot init memory Signed-off-by: Fengnan Chang Signed-off-by: Lin Li --- lib/eal/linux/eal_memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 60fc8

[PATCH 21.11] eal: cleanup alarm and hotplug before memory detach

2023-03-16 Thread Fengnan Chang
Alarm and multiprocess hotplug still need access hugepage memory, if alarm event processed after memory detach, it may cause SEGV. So cleanup alarm and multiprocess hotplug before memory detach. Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- 2 files

Re: [External] Re: [PATCH] malloc: fix malloc performance may becomes worse as the number of malloc increases

2023-02-16 Thread Fengnan Chang
Liang Ma 于2023年2月16日周四 22:04写道: > > On Wed, Feb 15, 2023 at 12:10:23PM +0100, Morten Brørup wrote: > > +CC: Fidaullah Noonari , your name also shows > > up in the git log; perhaps you can help review this patch. > > > > > > I gave up reviewing in depth, because the existing code is not easy to >

Re: [External] Re: [PATCH] malloc: fix malloc performance may becomes worse as the number of malloc increases

2023-02-15 Thread Fengnan Chang
Stephen Hemminger 于2023年2月16日周四 01:16写道: > > On Wed, 15 Feb 2023 12:10:23 +0100 > Morten Brørup wrote: > > > Looking isolated at the patch itself... > > > > I agree with the way the patch modifies the ranges of the free list, and > > the consequential removal of the "- 1" from the calculation of

[PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach

2023-02-13 Thread Fengnan Chang
0dd1 ("mem: cleanup multiprocess resources") Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 1b58cd3da6..83b99c601f 100644 --- a/l

[PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach

2023-02-13 Thread Fengnan Chang
0dd1 ("mem: cleanup multiprocess resources") Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 1b58cd3da6..83b99c601f 100644 --- a/l

[PATCH] malloc: fix malloc performance may becomes worse as the number of malloc increases

2023-02-09 Thread Fengnan Chang
reater than from a smaller size list. Signed-off-by: Fengnan Chang --- lib/eal/common/malloc_elem.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c index 83f05497cc..35a2313d04 100644 --- a/lib/eal/com

[PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach

2023-02-09 Thread Fengnan Chang
0dd1 ("mem: cleanup multiprocess resources") Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 1b58cd3da6..83b99c601f 100644 --- a/l

Re: [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach

2023-01-29 Thread Fengnan Chang
friendly ping Fengnan Chang 于2023年1月6日周五 11:00写道: > > Hi: > is there any comments? > > Fengnan Chang 于2022年12月21日周三 11:41写道: > > > > Alarm and multiprocess hotplug still need access hugepage memory, > > if alarm event processed after memory detach, it may cau

Re: [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach

2023-01-11 Thread Fengnan Chang
Hi: is there any comments? Fengnan Chang 于2022年12月21日周三 11:41写道: > > Alarm and multiprocess hotplug still need access hugepage memory, > if alarm event processed after memory detach, it may cause SEGV. > So cleanup alarm and multiprocess hotplug before memory detach. > > F

[PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach

2022-12-21 Thread Fengnan Chang
0dd1 ("mem: cleanup multiprocess resources") Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 1b58cd3da6..83b99c601f 100644 --- a/l

Re: [External] Re: [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach

2022-12-18 Thread Fengnan Chang
Thomas Monjalon 于2022年12月13日周二 16:34写道: > > 13/12/2022 08:59, Fengnan Chang: > > Alarm and multiprocess hotplug still need access hugepage memory, > > if alarm event processed after memory detach, it may cause SEGV. > > So cleanup alarm and multiprocess hotp

[PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach

2022-12-18 Thread Fengnan Chang
Alarm and multiprocess hotplug still need access hugepage memory, if alarm event processed after memory detach, it may cause SEGV. So cleanup alarm and multiprocess hotplug before memory detach. Signed-off-by: Fengnan Chang --- lib/eal/linux/eal.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [External] Re: [PATCH v2] mempool: fix rte_mempool_avail_count may segment fault when used in multiprocess

2022-11-29 Thread Fengnan Chang
Olivier Matz 于2022年11月22日周二 23:25写道: > > Hi, > > On Tue, Nov 15, 2022 at 08:35:02PM +0800, Fengnan Chang wrote: > > rte_mempool_create put tailq entry into rte_mempool_tailq list before > > populate, and pool_data set when populate. So in multi process, if > >

[PATCH v2] mempool: fix rte_mempool_avail_count may segment fault when used in multiprocess

2022-11-16 Thread Fengnan Chang
fault. Fix this by put tailq entry into rte_mempool_tailq after populate. Signed-off-by: Fengnan Chang --- lib/mempool/rte_mempool.c | 43 ++- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool

Re: [External] Re: [PATCH] mempool: fix rte_mempool_avail_count may segment fault when used in multiprocess

2022-11-15 Thread Fengnan Chang
Olivier Matz 于2022年11月15日周二 16:29写道: > > Hi, > > On Tue, Nov 15, 2022 at 08:47:15AM +0100, David Marchand wrote: > > On Tue, Nov 15, 2022 at 2:51 AM Fengnan Chang > > wrote: > > > > > > David Marchand 于2022年11月15日周二 04:44写道: > > > >

Re: [External] Re: [PATCH] mempool: fix rte_mempool_avail_count may segment fault when used in multiprocess

2022-11-15 Thread Fengnan Chang
David Marchand 于2022年11月15日周二 04:44写道: > > On Mon, Nov 14, 2022 at 9:13 AM changfengnan > wrote: > > > > rte_mempool_create put tailq entry into rte_mempool_tailq list before > > populate, and pool_data set when populate. So in multi process, if > > process A create mempool, and process B can ge