DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [Bug 800] rte_malloc fails to allocate memory block, but succeeds allocating bigger block
@ 2021-08-30 17:16 bugzilla
  2022-06-24  8:25 ` bugzilla
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla @ 2021-08-30 17:16 UTC (permalink / raw)
  To: dev

https://bugs.dpdk.org/show_bug.cgi?id=800

            Bug ID: 800
           Summary: rte_malloc fails to allocate memory block, but
                    succeeds allocating bigger block
           Product: DPDK
           Version: 18.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: maaaah@mail.ru
  Target Milestone: ---

rte_malloc succeeds allocating some memory, but fails to allocate less amount
(both on "clean" heap). While the behavior could be explained, it looks
counterintuitive. Would be fine to have at least some hint to guarantee
allocation success.


Machine specs:

Virtualbox VM
2 CPU
8G RAM

Also can be reproduced on some hardware, will provide specs if needed.


OS specs:

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

# uname -a
Linux test 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
x86_64 x86_64 GNU/Linux


Hugepages config:

# fgrep GRUB_CMDLINE_LINUX /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root
rd.lvm.lv=centos/swap rhgb quiet default_hugepagesz=2M hugepagesz=2M
hugepages=2560"

# fgrep HugePages_ /proc/meminfo
HugePages_Total:    2560
HugePages_Free:     2560
HugePages_Rsvd:        0
HugePages_Surp:        0



DPDK 18.11.11 (LTS)

Built using make:

# curl https://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz -O
# tar -xf dpdk-18.11.11.tar.xz
# cd dpdk-stable-18.11.11
# make T=x86_64-native-linuxapp-gcc config
# make
# make install


Steps to reproduce:

#include <rte_eal.h>
#include <rte_errno.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char** argv) {
        int result = rte_eal_init(argc, argv);
        if (result < 0) {
                printf("failed to init EAL: %s (%i)\n", strerror(rte_errno),
rte_errno);
                return result;
        }

        void *p = rte_malloc(NULL, 0xffffffff, 0);
        if (p) {
                printf("success\n");

                rte_free(p);
        } else {
                printf("failure\n");
        }

        p = rte_malloc(NULL, 0x100000000, 0);
        if (p) {
                printf("success\n");

                rte_free(p);
        } else {
                printf("failure\n");
        }
}


DPDK_HOME=/usr/local/share/dpdk/ RTE_SDK=/usr/local/share/dpdk/ make

./test-malloc --log-level 0


Expected result:

success
success


Actual result:

failure
success

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

end of thread, other threads:[~2022-06-24  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 17:16 [dpdk-dev] [Bug 800] rte_malloc fails to allocate memory block, but succeeds allocating bigger block bugzilla
2022-06-24  8:25 ` bugzilla

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