From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) by dpdk.org (Postfix) with ESMTP id DDAC71041 for ; Tue, 12 Sep 2017 05:10:30 +0200 (CEST) Received: by mail-io0-f179.google.com with SMTP id d16so38682949ioj.3 for ; Mon, 11 Sep 2017 20:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netgate.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tyAtmLe3xZ/XjcRHkuByBdl5nOBERG2lri0P6YQYSK0=; b=l4eHxM+Lpisieb9nBNW2pKEvyM2XD1rn+MQKlK5yU/FyemmIGMannKG4CkpN1//dpl kOavNjvS6CEngoFfhc/tzAndWRnt7VN3F1G5p3nVk4jeXs2k38L1FOqaTljnevqb35k0 jTRhz5+xoBCnOtg0Z3ichpYDJwl+gyRKxdwbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tyAtmLe3xZ/XjcRHkuByBdl5nOBERG2lri0P6YQYSK0=; b=Q17RaHlS37L/Twmzo3gDlaTHkbuSZ+vVW88ikM2Xzjx4INXzh+6BciHADLWBVpp/Kr fYBfDGuLFhHo/sHV0oD7MzbeUTh2IDHZxSBBbKZe/WpJ2+Bg8k5uav+U1xrCBmrudcQt 2+rVdGU9mdmqPpteElxwFrGkuJU9xeSFJVjglhAXRtxlBBj1ssdZwPttWnpFNpDHHtR/ xa9jEM7qOy7gLTIUaDdX2AHw5s/6ae0PyMVp6gZisZNBrUb/0nJVBTqpn0YfP7LQ4twI DsVMk2akVgGBlt9Zg9DNhcVIRrAMbqVJTfpw+LGVcbrb/CUFX/MZsTdCZJZej6z7VxzM /gvA== X-Gm-Message-State: AHPjjUgL7ka4J4EdFM4G8fV1vEQXxxLJvpCiNFgqxKV3Gq1/lHnvxr5+ 6VkCUjh7CbByOMsAsvFC6Q== X-Google-Smtp-Source: AOwi7QArqk3ZHhpIr2sG4m38sjFic5c8Hbrf3Ag84biLa+8noPhccocav7HUCy8mPfsJL+K4VElyZA== X-Received: by 10.202.102.139 with SMTP id m11mr12342114oik.309.1505185829656; Mon, 11 Sep 2017 20:10:29 -0700 (PDT) Received: from [172.21.0.131] (65-36-116-65.dyn.grandenetworks.net. [65.36.116.65]) by smtp.gmail.com with ESMTPSA id r129sm9973525oif.40.2017.09.11.20.10.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 20:10:28 -0700 (PDT) Mime-Version: 1.0 (1.0) From: Jim Thompson X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Mon, 11 Sep 2017 22:10:27 -0500 Cc: dev Message-Id: References: To: =?utf-8?B?55m96ZW/5pWP?= <912873551@qq.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] About the shared flock for hugepage files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2017 03:10:31 -0000 Bakari, This is so you can have > 1 DPDK application on a machine and they won't use= each other's hugepages.=20 See, for example the comments in clear_hugedir() http://dpdk.org/browse/dpdk/tree/lib/librte_eal/linuxapp/eal/eal_hugepage_in= fo.c#n198 Jim > On Sep 11, 2017, at 9:16 PM, =E7=99=BD=E9=95=BF=E6=95=8F <912873551@qq.com= > wrote: >=20 > Hi, everyone, >=20 >=20 > I'm a developer from china, now i have a problem is about the shared fl= ock for hugepage files in the function of "map_all_hugepages()". >=20 >=20 > as follows: > --------------------------------------------------------------------------= ------------------------- > /* set shared flock on the file. */ >=20 >=20 > if (flock(fd, LOCK_SH | LOCK_NB) =3D=3D -1) { >=20 >=20 > RTE_LOG(DEBUG, EAL, "%s(): Locking file failed:%s \n", __func__, st= rerror(errno)); >=20 >=20 > close(fd); >=20 >=20 > return i; >=20 >=20 > } >=20 >=20 > close(fd); >=20 > --------------------------------------------------------------------------= ------------------------ > there, it gives a shared flock to each hugepage file in /mnt/huge, and clo= se it right away.=20 >=20 >=20 > it makes me puzzled. Why? What doing that is for?=20 >=20 >=20 > I'm looking forward to your reply, thank you very much. >=20 >=20 > best regards, > Bakari.