DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] App crash when using no-huge option
@ 2015-07-15  7:34 damu
  2015-07-15  9:57 ` Gonzalez Monroy, Sergio
  2015-07-15 10:12 ` [dpdk-dev] [PATCH] eal: set hugepgae_sz to 4KB when using --no-huge Sergio Gonzalez Monroy
  0 siblings, 2 replies; 4+ messages in thread
From: damu @ 2015-07-15  7:34 UTC (permalink / raw)
  To: dev

Hi,

Today I tried no-huge option with app/test, the test app crashed.
It seems that memory can not be allocated. 
I think it could be this change causing the panic. Can someone check it?

commit 2d65283c259616a5643599ce32d7a62d174ec49e
Author: Cyril Chemparathy <cchemparathy@ezchip.com>
Date:   Thu Jul 9 16:25:14 2015 +0800

    mem: refactor memzone reserve functions


 sudo ./app/test -c 3 -n 2 --no-huge

EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 0 on socket 0
EAL: Detected lcore 5 as core 1 on socket 0
EAL: Detected lcore 6 as core 2 on socket 0
EAL: Detected lcore 7 as core 3 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 8 lcore(s)
EAL: VFIO modules not all loaded, skip VFIO support...
EAL: Setting up memory...
RING: Cannot reserve memory for tailq
EAL: rte_eal_common_log_init(): cannot create log_history mempool
PANIC in rte_eal_init():
Cannot init logs
6: [./app/test() [0x42c1f3]]
5: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f1d65354ec5]]
4: [./app/test(main+0x11) [0x42a161]]
3: [./app/test(rte_eal_init+0xeae) [0x5106fe]]
2: [./app/test(__rte_panic+0xc9) [0x425c6e]]
1: [./app/test(rte_dump_stack+0x18) [0x516e28]]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] App crash when using no-huge option
  2015-07-15  7:34 [dpdk-dev] App crash when using no-huge option damu
@ 2015-07-15  9:57 ` Gonzalez Monroy, Sergio
  2015-07-15 10:12 ` [dpdk-dev] [PATCH] eal: set hugepgae_sz to 4KB when using --no-huge Sergio Gonzalez Monroy
  1 sibling, 0 replies; 4+ messages in thread
From: Gonzalez Monroy, Sergio @ 2015-07-15  9:57 UTC (permalink / raw)
  To: damu; +Cc: dev

On 15/07/2015 08:34, damu wrote:
> Hi,
>
> Today I tried no-huge option with app/test, the test app crashed.
> It seems that memory can not be allocated.
> I think it could be this change causing the panic. Can someone check it?
>
>
Hi Damu,

Actually it is the following commit causing the panic:

commit b3dfffd962ecd7a1d8700193b4b3305dc85e7ae4
Author: Cyril Chemparathy <cchemparathy@ezchip.com>
Date:   Thu Jul 9 16:25:15 2015 +0800

     mem: allow multiple page sizes to be requested

Cause is that since allowing multiple page sizes it always expects the 
hugepage_sz
field to be set to a value, but when using --no-huge, the field 
hugepage_sz is 0 and
the logic does not work as expected.

The issue could be fixed but adding logic to expect hugepage_sz being 0 
or by setting
hugepage_sz to a value (RTE_PGSIZE_4K) when using --no-huge.

The latter would be my preference. I'll send a patch fixing it.

Sergio

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH] eal: set hugepgae_sz to 4KB when using --no-huge
  2015-07-15  7:34 [dpdk-dev] App crash when using no-huge option damu
  2015-07-15  9:57 ` Gonzalez Monroy, Sergio
@ 2015-07-15 10:12 ` Sergio Gonzalez Monroy
  2015-07-15 12:29   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Sergio Gonzalez Monroy @ 2015-07-15 10:12 UTC (permalink / raw)
  To: dev

After code rework from bellow commit, logic expects hugepage_sz field to
always be set (ie. not zero value).
When using --no-huge, this field was left unset defaulting to zero.

Set hugepage_sz to RTE_PGSIZE_4K when using --no-huge.

Fixes: b3dfffd962ecd ("mem: allow multiple page sizes to be requested")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 lib/librte_eal/bsdapp/eal/eal_memory.c   | 1 +
 lib/librte_eal/linuxapp/eal/eal_memory.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 33ebd0f..a3242a5 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -75,6 +75,7 @@ rte_eal_contigmem_init(void)
 		addr = malloc(internal_config.memory);
 		mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
 		mcfg->memseg[0].addr = addr;
+		mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
 		mcfg->memseg[0].len = internal_config.memory;
 		mcfg->memseg[0].socket_id = 0;
 		return 0;
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index e501c49..4fd63bb 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1069,6 +1069,7 @@ rte_eal_hugepage_init(void)
 		}
 		mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
 		mcfg->memseg[0].addr = addr;
+		mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
 		mcfg->memseg[0].len = internal_config.memory;
 		mcfg->memseg[0].socket_id = SOCKET_ID_ANY;
 		return 0;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: set hugepgae_sz to 4KB when using --no-huge
  2015-07-15 10:12 ` [dpdk-dev] [PATCH] eal: set hugepgae_sz to 4KB when using --no-huge Sergio Gonzalez Monroy
@ 2015-07-15 12:29   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2015-07-15 12:29 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy; +Cc: dev

2015-07-15 11:12, Sergio Gonzalez Monroy:
> After code rework from bellow commit, logic expects hugepage_sz field to
> always be set (ie. not zero value).
> When using --no-huge, this field was left unset defaulting to zero.
> 
> Set hugepage_sz to RTE_PGSIZE_4K when using --no-huge.
> 
> Fixes: b3dfffd962ecd ("mem: allow multiple page sizes to be requested")
> 
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-15 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15  7:34 [dpdk-dev] App crash when using no-huge option damu
2015-07-15  9:57 ` Gonzalez Monroy, Sergio
2015-07-15 10:12 ` [dpdk-dev] [PATCH] eal: set hugepgae_sz to 4KB when using --no-huge Sergio Gonzalez Monroy
2015-07-15 12:29   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).