From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF9FCA04F3 for ; Thu, 19 Dec 2019 17:24:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D7771BDFD; Thu, 19 Dec 2019 17:24:05 +0100 (CET) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) by dpdk.org (Postfix) with ESMTP id 99C881BC25 for ; Thu, 19 Dec 2019 17:24:03 +0100 (CET) Received: by mail-oi1-f173.google.com with SMTP id 18so2423001oin.9 for ; Thu, 19 Dec 2019 08:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jG+U9PMrZ6RrvfX8R3cmBb7moWthSSGum+ROsrS/qx0=; b=OGXxNroTjiUJxbN3prh0vrQ+DApowwX9zSzZIPeoP+j6dg3yrYEx9dMcJjMORB8lQf XthLvNdAHZSsXCqRI9SGnjbYwox803EbK5EqctpoiGJeZBo0cfF33KH6IigPptBDl+UK C7LzOBUS5UHY6e1GfpclcHxqJuE4iJVm0Ps5mDz4tq2jsrwkielqNf6M9QTylnoZj6+a 3O1vZA4RsYebl70O0K1zATWr7nTS2PrX/mX3TNjoapFWgO2yQhLi8zV7qvLJhrKWQVLN zmhCrSctZLwfh9dadaGqtBrM5ijekebKIE+97iZU8R2RvRYzaMH2V5gBeCeacreiWf6I lrBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jG+U9PMrZ6RrvfX8R3cmBb7moWthSSGum+ROsrS/qx0=; b=ZojabLN10SRycE64GssR9gtXhPlPVk3u/t8AyGEciuxIIQ7yZCdXqxAglX9kMYjOcE uYrkYwpfOG5B7dbuWfDAzOT3to4pkRa71xrKAo3hF0YhpOkyQSjnm3plbP6lJnwfuUom j4dazf02/PyXnYklSqfQOpTrvxzx9JsiIPeSr1pS3GfwZmaGUE5pbgqxsmPoszhphr4m XQm+hRWoC4CtE/DJK5APUUR3/iLISL1ZhZHXFyv6WxxA5AzQaHWyMbXBLCUgW7BTtOlE nqlxaVECVOaInoiin9Bd+qOTj7qhqEsFU1h5wgAWY5zSMSMZNos2e2AKst5Bz5sVV/Cd w5Vg== X-Gm-Message-State: APjAAAXRK/NtNhELMMYPZclsPOaVsifmQenQWcNBZnGq2xSEG9EcX2tv mg6crvOq0lXjIRZQhsFnlJrpGMFJOosN0bP/L9lbsjcQBFM= X-Google-Smtp-Source: APXvYqwwTh6TbG5rc8ZCHDKu/Dv0RsTdAeju/f9hBenSAGMhmLqe03vb6da7jGSOA/8YqzJ7St9Q69v8/M/SXZUZr3Q= X-Received: by 2002:aca:f456:: with SMTP id s83mr2375990oih.12.1576772642468; Thu, 19 Dec 2019 08:24:02 -0800 (PST) MIME-Version: 1.0 From: Byonggon Chun Date: Fri, 20 Dec 2019 01:23:50 +0900 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] Should ''shmget" not be used to consume hugepages in DPDK? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi all. I'm Kubernetes contributors and I'm working to make container isolation of hugepages that allows us to set hugepages limit per container cgroup. (At this point, limits are set on pod level cgroup even though we asked hugepages as the container level resource) I tore down testPMD and some parts of DPDK lib and I got a question after i found there is no usage of "shmget" in DPDK. My question is that Should "shmget" not be used to consume hugepages in DPDK? And here is following questions: 1) If we don't have to use "shmget", Why? Does it affect performance? 2) If I use "shmget" to get hugepages, should I call "mlock" syscall for it? For more details, as I know there are three ways to consume hugepages in kubernetes. 1) shmget with SHM_HUGETLB 2) mmap with hugetlbs filebacking 3) mmap with MAP_ANONYMOUS | MAP_HUGETLB And I found that testPMD calls mlock syscall when it maps an anonymous hugepages or external allocated hugepages. https://github.com/DPDK/dpdk/blob/924e55fb340623f03fdf2ff7fbcfd78819d1db25/app/test-pmd/testpmd.c#L896 https://github.com/DPDK/dpdk/blob/924e55fb340623f03fdf2ff7fbcfd78819d1db25/app/test-pmd/testpmd.c#L916 Thanks.