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 4D60C41C8A for ; Mon, 13 Feb 2023 16:46:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E2E240EF1; Mon, 13 Feb 2023 16:46:17 +0100 (CET) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 44DEA40EE4 for ; Mon, 13 Feb 2023 16:46:16 +0100 (CET) Received: by mail-ed1-f49.google.com with SMTP id cq19so10766499edb.5 for ; Mon, 13 Feb 2023 07:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=a+S+SWFX/+QLKGxWGnzy8z5HdHeRAxvRL86t7fVCOKE=; b=IL3E+Co9Yy2r6gyzyteky5jhGCGd9jhx0T0QEY1p/VeIBOtINfks/YMvmnqkppinqV 8UyfWDsd6BTNVpP16BrX4lva9GsFv5n9/S64RnngNpGaIePiR/wBykrdxZVKsz9K6R/0 H/E7RnRp+bjVp3wanwtuIPWgrrEiPqChWxlg2K1mQwWghF4FZeuapowtHGaCskZy41Zi p8gJwChWRILwfLzw8GyvLfc8UtJCh4Jp/XAEZCjzkYzxztDEAVfp6UOByG48nHJQhdVO o5HvYMxXfI2aRaKKV/839/rzJkYdwI97u2KS462a0do2d4GztahLZ5pveaGxeRD4Pqdg ruZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a+S+SWFX/+QLKGxWGnzy8z5HdHeRAxvRL86t7fVCOKE=; b=3+qQxEusxyifPSCY+qjRILHX0R/U0AArp+vAqQ7e2KSWbSKmIZchZhqHp0jjNtbQMT nX2r7/5/QUL5uLy5gMjhsWKmbE6wSwaK5o+71Mqy+crQN+7qrqmkR1REIhmWhCrkwfOZ 6aXNdIzWlIfU4PYItzh2X1oxW3QE9oRvWZZ+KzpRXhv2fL8TGIx//X4gOZNrvid1nyzo D+KFgJU3f0Ih6Hm8vDjfiZaAh/IcKiJ3oJ128MNyt+Zzrp5x4KxQkWPn6cwBe3SNpXxO aD+U2+D9+1wTqUhAvUCesUxckglq7rTueOgMX7Kir3LUEah2CVxM+Z7pKBuuYgL8y0c2 bQ+Q== X-Gm-Message-State: AO0yUKU7kjgtguyi2D36VasCPm5roHrRDb0Zou+s87nfnSMNwWZaFxsJ UcGaf5yLbICWLT46AnJ3IPc= X-Google-Smtp-Source: AK7set/lxfmDAIxW2A8uNRHhkHkVCVqTtDKLl21Qfiy1p41P/Xx7zw/fTVzum+aIgyB09HX63q7SZA== X-Received: by 2002:a50:a413:0:b0:4ac:bdf7:1c3f with SMTP id u19-20020a50a413000000b004acbdf71c3fmr6030848edb.29.1676303175907; Mon, 13 Feb 2023 07:46:15 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id m2-20020a50d7c2000000b004acc123cd94sm2487602edj.30.2023.02.13.07.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 07:46:15 -0800 (PST) Date: Mon, 13 Feb 2023 18:46:14 +0300 From: Dmitry Kozlyuk To: Szymon Szozda Cc: users@dpdk.org Subject: Re: Dpdk allocates more memory, than available physically (hugepages) Message-ID: <20230213184614.3039b1af@sovereign> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org 2023-02-08 03:43 (UTC+0100), Szymon Szozda: > Hey, > I'm running dpdk on a machine with 64GB of RAM. It is configured, so 16GiB > (16 x 1GiB chunks) of hugepage memory is reserved on boot. I was expecting > dpdk to consume only those 16GiB, but it seems it gets more than 30GiB of > virtual memory ( I base it on memory VSZ output of top command ). The > machine is 1 NUMA, 1 NIC. I did some debugging and I do not see any logic > which limits the memory consumption, basically it seems that > eal_dynmem_memseg_lists_init() will allocate the same amount, no matter how > much RAM is physically available. > > Is it expected? How to know that setup will not crash due to > insufficient memory available? How to limit those memory consumption.by > dpdk? Hi, DPDK always reserves a large chunk of virtual address space, but this costs almost nothing and does not need to be limited. Then DPDK maps and unmaps actual pages to those addresses as needed. DPDK does not crash if it runs out of hugepages reserved in the system but merely returns NULL from its allocation API (rte_malloc). Real memory consumption can be limited with --socket-limit EAL option. See also --socket-mem and -m to reserve hugepages at DPDK startup.