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 70CD6A04F8 for ; Fri, 20 Dec 2019 13:42:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5EF51F1C; Fri, 20 Dec 2019 13:42:17 +0100 (CET) Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by dpdk.org (Postfix) with ESMTP id 0989A1252 for ; Fri, 20 Dec 2019 13:42:16 +0100 (CET) Received: by mail-oi1-f193.google.com with SMTP id p67so4336391oib.13 for ; Fri, 20 Dec 2019 04:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nciPRcblBmZTDNlAVK6J2i1orwFdf8EARdAXgdOnrgA=; b=fwwoVyfrXQBz1TvEbPOdRHbY36OwC7dUeQETmVV4aFY7mJXe5q17+qXdit/JRoL2X1 42ohDxHV67Fc3nZMNR2Vxzv/CQgTrgcM0M3h1z7XM5ne8/LUNCJhnSfA9ZrYUzfjtV0y Nmm8c9lVakzHnLJsub1ZddrpfcqpxwEndPTwLwq04aCuopF1jkum2UDo0kYbBZTozikG 28D54upolk+IGbTBnJ0LFY5AoBi9XJtS3agJTpFPc4WzgEdYkbyv/S6zcBd7qwki/5qC UyXeWAIF6AbrHaopUjhYflYY0ZURrEIf5ughi/vls8FgIcK4rTpP2QsmWp0HMJcoymqM gFrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nciPRcblBmZTDNlAVK6J2i1orwFdf8EARdAXgdOnrgA=; b=PfgzmEGJphTYlnr/jCSTYKu7of8np4z9S52ZSqLTpBSDPQ9rpJ9c8SPFkdc81XZ9yl X8Ahk8oH70IXXwAWp3pfJD/W/NJCpCUga1cgMpZf2LRVPrfl5Y72xz7RHKP0xlLAcLPO 4wvmn3kJLx3467Ce6uBunlONNfw2TZ/ieIfr7HxKQiou0n2bBmRIdXc4umHAZVBFWct7 wAJJYK6V+vXT10aB9W+CRb5W9QCnfb2A4iV+G7F0T+oJO9BaDEh+arLtk0FIT26Bu5i3 vExsIFyRr7NPX1Qdkp0D1bJhYzbSBEySEikxY/E54jsZCOGdIQbMB4VIkfPxbnYCI+n9 SDwA== X-Gm-Message-State: APjAAAVDThb/ybo3aVbWiiHUH2J5ICF/LDq6Ldv4m+wA9/Qy2PJIV3cF 4tyPzEsBTO/WkAtfxL4fDXG2TeVQedgKUyneMUmHsoZd27A= X-Google-Smtp-Source: APXvYqwArMN1Aj+/C1S3B/Gd3YTudFomp0bvk7gBxjd60neqWNpRBuNgcUgxeHAKxCQGrX1eEbIkV/TDdCVKA/ZdfJg= X-Received: by 2002:aca:72d0:: with SMTP id p199mr3820011oic.40.1576845735198; Fri, 20 Dec 2019 04:42:15 -0800 (PST) MIME-Version: 1.0 References: <20191219130620.30ade5fa@hermes.lan> In-Reply-To: <20191219130620.30ade5fa@hermes.lan> From: Byonggon Chun Date: Fri, 20 Dec 2019 21:42:03 +0900 Message-ID: To: Stephen Hemminger Cc: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [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" > shmget is a legacy Unix API and there is no point in using it. Yeah, I agree with it, I also prefer to use mmap with hugetlbfs in a DPDK container. The reason why I started this mail thread is some DPDK users still use shmget to consume hugepages, and I just wanted to find a good rationale to convince them to use mmap. But, at this point, I have only one rationale : shmget is a legacy UINIX API. On Fri, Dec 20, 2019 at 6:06 AM Stephen Hemminger < stephen@networkplumber.org> wrote: > On Fri, 20 Dec 2019 01:23:50 +0900 > Byonggon Chun wrote: > > > 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. > > shmget is a legacy Unix API and there is no point in using it. > For new applications libhugetlbfs is preferable. >