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 C084DA04F3 for ; Thu, 19 Dec 2019 22:06:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3C891BDFD; Thu, 19 Dec 2019 22:06:31 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by dpdk.org (Postfix) with ESMTP id 440A91B9BF for ; Thu, 19 Dec 2019 22:06:30 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id s21so384111plr.7 for ; Thu, 19 Dec 2019 13:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x8/ifQajhisERQI3dxJaT19rc9liVjVcbfNxG4ifUoQ=; b=PWgKR/+3IC32gt+XLuvGDzyYdJ6zFpnzsOUg3r9VL4gK9xME9MvPOita9HISlDQCOi OIfxtwHwe2Vf94BuM2vFrUkLIw7PyxffmTbfC1HUUe8r5qkoupvH7xnMcDttGUnTV/aj 26ShQwoepnFdbPN8OtlX5/fX1mZ+Ho+QGwiYVgMTW1mqBC+MZhzhMPHeEGs0xAkSbAtc 8DnkxeF7zEmiUrN9wOyZDVK++mjRDJbooqAm/m/t2XhW1SxgY3uXl6TRCO7J1WcUpKr9 6Quz1a3lovjbsRMFnoxUxCvyIbRoE7+FicOhlIZAEa/qDVeHyBqBjI/t8HlYFaIqikSk cjng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x8/ifQajhisERQI3dxJaT19rc9liVjVcbfNxG4ifUoQ=; b=K90DuP3LsuLhM7TmdpAWP7sRafTJQZzQ1KSQKdeTgTI0hWvpzfB7sqwQ3a8IwyPBH0 5hBaA+RqshsQsdOfsw+YFKjJmQ47yyqwuTdENjD9q7LbE976w1IOhB+zYTnalP3ddujL WQ6PNCGYoz5Likj256TNQJ1vyAVogKhE1xwLLhDOivqATfNUMmlcCUer66CYT/mW9cHs EOJ2Vhrg39OQ3lgyadsM6+AaWjSrxpw8N88Tcny3gj8QvCHAMNRwOBB+MjvCUBpRUSMx +DNYoF22G56kHkmGKFlxrpynzstVIpuC8DvY/WW04C0iB3LZEYxmtimRolqJDmXh8hDp pDMA== X-Gm-Message-State: APjAAAUoSVODG58Ra/q1wnfl6aO2JtGN/Kux1792a8eSOqQLy/WmL8il hc1YHnHLpkq3fcDC88+eV3DxcA== X-Google-Smtp-Source: APXvYqzAseHpEJsVDv5/kuSuqLosZEjjNLTdvsJ6vUl0Shgy3q6lyxYQfmQX/aj6rJ401LD4Y3+KCA== X-Received: by 2002:a17:902:7792:: with SMTP id o18mr10378544pll.31.1576789589269; Thu, 19 Dec 2019 13:06:29 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b128sm8273696pga.43.2019.12.19.13.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 13:06:29 -0800 (PST) Date: Thu, 19 Dec 2019 13:06:20 -0800 From: Stephen Hemminger To: Byonggon Chun Cc: users@dpdk.org Message-ID: <20191219130620.30ade5fa@hermes.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" 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.