From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6251945CB4; Fri, 8 Nov 2024 17:15:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 253E143348; Fri, 8 Nov 2024 17:15:29 +0100 (CET) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 6F7034025C for ; Fri, 8 Nov 2024 17:15:28 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id F38E81C872 for ; Fri, 8 Nov 2024 17:15:27 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E7E781C871; Fri, 8 Nov 2024 17:15:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.2 Received: from [192.168.1.85] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 60BE21C8DF; Fri, 8 Nov 2024 17:15:26 +0100 (CET) Message-ID: <6807ac02-459e-4e5b-bf63-1766ac361841@lysator.liu.se> Date: Fri, 8 Nov 2024 17:15:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: strange DPDK memory allocator behavior From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= To: Thomas Monjalon , anatoly.burakov@intel.com, =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Bruce Richardson , Dmitry Kozlyuk Cc: David Marchand , dev@dpdk.org References: <5579642.iZASKD2KPV@thomas> <6b1fe860-5b86-4576-aeab-6b496102b43d@lysator.liu.se> Content-Language: en-US In-Reply-To: <6b1fe860-5b86-4576-aeab-6b496102b43d@lysator.liu.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2024-11-08 17:08, Mattias Rönnblom wrote: > On 2024-11-08 16:03, Thomas Monjalon wrote: >> Hello, >> >> After merging the lcore variables allocation from Mattias, >> we've seen an issue in unit tests running on 32-bit plaftorms: >>     https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/ >> dpdk/Debian_Testing/i586 >> The initialization has this error message "most of the time": >>     EAL: Cannot get a virtual area: Cannot allocate memory >> >> David did more tests with this command: >> # (for i in $(seq 10); do echo | LD_LIBRARY_PATH=lib:drivers app/dpdk- >> test --no-huge -m 2048 -d drivers; done) |& grep 'Cannot get a virtual >> area: Cannot allocate memory' >> >> EAL: Cannot get a virtual area: Cannot allocate memory >> EAL: Cannot get a virtual area: Cannot allocate memory >> EAL: Cannot get a virtual area: Cannot allocate memory >> >> There are 2 interesting findings: >> >> - the issue disappears when changing allocation size 2048 >>    to more (4096) or less (1024) >> >> - the issue disappears when removing some big static arrays from unit >> tests >>    like "sarray_lcore_state" in test_lcore_var_perf.c >>    Should we avoid having such big arrays in our unit tests? > > Wouldn't that be just removing a test that triggers a DPDK bug, rather > than fixing the bug? 128 kB is not big and some other app could easily > have such objects in BSS. > 128 kB should be 16 MB. What is a factor of 128 between friends? >> >> I don't understand how "-m 2048" is impacted by the static allocations. > > The ~128 kB of BSS will change the addresses of the heap to generally > somewhat higher numbers, since the heap is mapped in after BSS (I > think). But with ASLR, I'm not sure it would matter. I'm also not sure > how ASLR works on 32-bit systems, so maybe it could matter. > > Are there any attempts made to mmap() something at some particular > hardcoded address? Far fetched. > >> And I wonder how it could impact memory fragmentation >> so 2048 MB cannot be allocated but more or less are working fine. >> > > If you get an error during EAL initialization, pages to host those > test_lcore_var_perf static arrays aren't allocated yet. > >> It looks like an issue in the DPDK allocator. >> Note that we are using --no-huge for these tests. >> Any ideas? >> >> >