DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal/linux: lower log level on allocation attempt failure
@ 2024-06-26 14:51 David Marchand
  2024-06-26 14:59 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2024-06-26 14:51 UTC (permalink / raw)
  To: dev; +Cc: Ales Musil, stable, Anatoly Burakov

On a ARM system with only 2MB hugepages configured, EAL emits an error
log with allocations larger than 512MB.

Example with testpmd:
$ dpdk-testpmd --in-memory --no-pci --log-level=*:debug -- -i
...
EAL: In-memory mode enabled, hugepages of size 33554432 bytes will be
	allocated anonymously
EAL: No free 32768 kB hugepages reported on node 0
EAL: In-memory mode enabled, hugepages of size 65536 bytes will be
	allocated anonymously
EAL: No free 64 kB hugepages reported on node 0
EAL: In-memory mode enabled, hugepages of size 1073741824 bytes will be
	allocated anonymously
EAL: No free 1048576 kB hugepages reported on node 0
...
EAL: Detected memory type: socket_id:0 hugepage_sz:1073741824
EAL: Detected memory type: socket_id:0 hugepage_sz:33554432
EAL: Detected memory type: socket_id:0 hugepage_sz:2097152
EAL: Detected memory type: socket_id:0 hugepage_sz:65536
EAL: Creating 2 segment lists: n_segs:32 socket_id:0
	hugepage_sz:1073741824
...
EAL: Creating 2 segment lists: n_segs:1024 socket_id:0
	hugepage_sz:33554432
...
EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
	hugepage_sz:2097152
...
EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
	hugepage_sz:65536
...
EAL: Trying to obtain current memory policy.
EAL: Setting policy MPOL_PREFERRED for socket 0
EAL: alloc_seg(): mmap() failed: Cannot allocate memory
EAL: Ask a virtual area of 0x40000000 bytes
EAL: Virtual area found at 0x140000000 (size = 0x40000000)
EAL: attempted to allocate 2 segments, but only 0 were allocated
EAL: Restoring previous memory policy: 4
EAL: Trying to obtain current memory policy.
EAL: Setting policy MPOL_PREFERRED for socket 0
EAL: eal_memalloc_alloc_seg_bulk(): couldn't find suitable memseg_list
EAL: Restoring previous memory policy: 4
EAL: Trying to obtain current memory policy.
EAL: Setting policy MPOL_PREFERRED for socket 0
EAL: Restoring previous memory policy: 4
EAL: request: mp_malloc_sync
EAL: No shared files mode enabled, IPC is disabled
EAL: Heap on socket 0 was expanded by 1064MB
...

The reason is that the memzone allocation (~1GB large) would require
17017 (32kB) segments. However, as displayed in the early logs, a 32kB
memory segment list can only host 8192 segments (controlled by the build
option RTE_MAX_MEMSEG_PER_LIST).

This log message is misleading as there is no issue in the end: the
allocation succeeded with 2MB hugepages.

Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/linux/eal_memalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 0cc3295994..e354efc95d 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -1061,7 +1061,7 @@ eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs, size_t page_sz,
 	/* memalloc is locked, so it's safe to use thread-unsafe version */
 	ret = rte_memseg_list_walk_thread_unsafe(alloc_seg_walk, &wa);
 	if (ret == 0) {
-		EAL_LOG(ERR, "%s(): couldn't find suitable memseg_list",
+		EAL_LOG(DEBUG, "%s(): couldn't find suitable memseg_list",
 			__func__);
 		ret = -1;
 	} else if (ret > 0) {
-- 
2.45.2


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

* Re: [PATCH] eal/linux: lower log level on allocation attempt failure
  2024-06-26 14:51 [PATCH] eal/linux: lower log level on allocation attempt failure David Marchand
@ 2024-06-26 14:59 ` Stephen Hemminger
  2024-07-09  8:57   ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2024-06-26 14:59 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Ales Musil, stable, Anatoly Burakov

On Wed, 26 Jun 2024 16:51:42 +0200
David Marchand <david.marchand@redhat.com> wrote:

> On a ARM system with only 2MB hugepages configured, EAL emits an error
> log with allocations larger than 512MB.
> 
> Example with testpmd:
> $ dpdk-testpmd --in-memory --no-pci --log-level=*:debug -- -i
> ...
> EAL: In-memory mode enabled, hugepages of size 33554432 bytes will be
> 	allocated anonymously
> EAL: No free 32768 kB hugepages reported on node 0
> EAL: In-memory mode enabled, hugepages of size 65536 bytes will be
> 	allocated anonymously
> EAL: No free 64 kB hugepages reported on node 0
> EAL: In-memory mode enabled, hugepages of size 1073741824 bytes will be
> 	allocated anonymously
> EAL: No free 1048576 kB hugepages reported on node 0
> ...
> EAL: Detected memory type: socket_id:0 hugepage_sz:1073741824
> EAL: Detected memory type: socket_id:0 hugepage_sz:33554432
> EAL: Detected memory type: socket_id:0 hugepage_sz:2097152
> EAL: Detected memory type: socket_id:0 hugepage_sz:65536
> EAL: Creating 2 segment lists: n_segs:32 socket_id:0
> 	hugepage_sz:1073741824
> ...
> EAL: Creating 2 segment lists: n_segs:1024 socket_id:0
> 	hugepage_sz:33554432
> ...
> EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
> 	hugepage_sz:2097152
> ...
> EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
> 	hugepage_sz:65536
> ...
> EAL: Trying to obtain current memory policy.
> EAL: Setting policy MPOL_PREFERRED for socket 0
> EAL: alloc_seg(): mmap() failed: Cannot allocate memory
> EAL: Ask a virtual area of 0x40000000 bytes
> EAL: Virtual area found at 0x140000000 (size = 0x40000000)
> EAL: attempted to allocate 2 segments, but only 0 were allocated
> EAL: Restoring previous memory policy: 4
> EAL: Trying to obtain current memory policy.
> EAL: Setting policy MPOL_PREFERRED for socket 0
> EAL: eal_memalloc_alloc_seg_bulk(): couldn't find suitable memseg_list
> EAL: Restoring previous memory policy: 4
> EAL: Trying to obtain current memory policy.
> EAL: Setting policy MPOL_PREFERRED for socket 0
> EAL: Restoring previous memory policy: 4
> EAL: request: mp_malloc_sync
> EAL: No shared files mode enabled, IPC is disabled
> EAL: Heap on socket 0 was expanded by 1064MB
> ...
> 
> The reason is that the memzone allocation (~1GB large) would require
> 17017 (32kB) segments. However, as displayed in the early logs, a 32kB
> memory segment list can only host 8192 segments (controlled by the build
> option RTE_MAX_MEMSEG_PER_LIST).
> 
> This log message is misleading as there is no issue in the end: the
> allocation succeeded with 2MB hugepages.
> 
> Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

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

* Re: [PATCH] eal/linux: lower log level on allocation attempt failure
  2024-06-26 14:59 ` Stephen Hemminger
@ 2024-07-09  8:57   ` David Marchand
  0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2024-07-09  8:57 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Ales Musil, stable, Anatoly Burakov, Stephen Hemminger

On Wed, Jun 26, 2024 at 5:00 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Wed, 26 Jun 2024 16:51:42 +0200
> David Marchand <david.marchand@redhat.com> wrote:
>
> > On a ARM system with only 2MB hugepages configured, EAL emits an error
> > log with allocations larger than 512MB.
> >
> > Example with testpmd:
> > $ dpdk-testpmd --in-memory --no-pci --log-level=*:debug -- -i
> > ...
> > EAL: In-memory mode enabled, hugepages of size 33554432 bytes will be
> >       allocated anonymously
> > EAL: No free 32768 kB hugepages reported on node 0
> > EAL: In-memory mode enabled, hugepages of size 65536 bytes will be
> >       allocated anonymously
> > EAL: No free 64 kB hugepages reported on node 0
> > EAL: In-memory mode enabled, hugepages of size 1073741824 bytes will be
> >       allocated anonymously
> > EAL: No free 1048576 kB hugepages reported on node 0
> > ...
> > EAL: Detected memory type: socket_id:0 hugepage_sz:1073741824
> > EAL: Detected memory type: socket_id:0 hugepage_sz:33554432
> > EAL: Detected memory type: socket_id:0 hugepage_sz:2097152
> > EAL: Detected memory type: socket_id:0 hugepage_sz:65536
> > EAL: Creating 2 segment lists: n_segs:32 socket_id:0
> >       hugepage_sz:1073741824
> > ...
> > EAL: Creating 2 segment lists: n_segs:1024 socket_id:0
> >       hugepage_sz:33554432
> > ...
> > EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
> >       hugepage_sz:2097152
> > ...
> > EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
> >       hugepage_sz:65536
> > ...
> > EAL: Trying to obtain current memory policy.
> > EAL: Setting policy MPOL_PREFERRED for socket 0
> > EAL: alloc_seg(): mmap() failed: Cannot allocate memory
> > EAL: Ask a virtual area of 0x40000000 bytes
> > EAL: Virtual area found at 0x140000000 (size = 0x40000000)
> > EAL: attempted to allocate 2 segments, but only 0 were allocated
> > EAL: Restoring previous memory policy: 4
> > EAL: Trying to obtain current memory policy.
> > EAL: Setting policy MPOL_PREFERRED for socket 0
> > EAL: eal_memalloc_alloc_seg_bulk(): couldn't find suitable memseg_list
> > EAL: Restoring previous memory policy: 4
> > EAL: Trying to obtain current memory policy.
> > EAL: Setting policy MPOL_PREFERRED for socket 0
> > EAL: Restoring previous memory policy: 4
> > EAL: request: mp_malloc_sync
> > EAL: No shared files mode enabled, IPC is disabled
> > EAL: Heap on socket 0 was expanded by 1064MB
> > ...
> >
> > The reason is that the memzone allocation (~1GB large) would require
> > 17017 (32kB) segments. However, as displayed in the early logs, a 32kB
> > memory segment list can only host 8192 segments (controlled by the build
> > option RTE_MAX_MEMSEG_PER_LIST).
> >
> > This log message is misleading as there is no issue in the end: the
> > allocation succeeded with 2MB hugepages.
> >
> > Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2024-07-09  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 14:51 [PATCH] eal/linux: lower log level on allocation attempt failure David Marchand
2024-06-26 14:59 ` Stephen Hemminger
2024-07-09  8:57   ` David Marchand

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).