From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH 8/8] mem: support using memfd segments for in-memory mode Date: Fri, 24 Aug 2018 10:09:01 +0530 Message-ID: <20180824043900.GA9021@jerin> References: <4e780007ecfc3c1c5e8a249f69236b407d2e98d0.1535041359.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, maxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com To: Anatoly Burakov Return-path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700074.outbound.protection.outlook.com [40.107.70.74]) by dpdk.org (Postfix) with ESMTP id AF5732C0C for ; Fri, 24 Aug 2018 06:39:21 +0200 (CEST) Content-Disposition: inline In-Reply-To: <4e780007ecfc3c1c5e8a249f69236b407d2e98d0.1535041359.git.anatoly.burakov@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Thu, 23 Aug 2018 17:59:55 +0100 > From: Anatoly Burakov > To: dev@dpdk.org > CC: tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, > maxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com > Subject: [dpdk-dev] [PATCH 8/8] mem: support using memfd segments for > in-memory mode > X-Mailer: git-send-email 1.7.0.7 > > > Enable using memfd-created segments if supported by the system. > > This will allow having real fd's for pages but without hugetlbfs > mounts, which will enable in-memory mode to be used with virtio. > > The implementation is mostly piggy-backing on existing real-fd > code, except that we no longer need to unlink any files or track > per-page locks in single-file segments mode, because in-memory > mode does not support secondary processes anyway. > > We move some checks from EAL command-line parsing code to memalloc > because it is now possible to use single-file segments mode with > in-memory mode, but only if memfd is supported. > > Signed-off-by: Anatoly Burakov > --- > lib/librte_eal/common/eal_common_options.c | 6 +- > lib/librte_eal/linuxapp/eal/eal_memalloc.c | 265 ++++++++++++++++++--- > 2 files changed, 235 insertions(+), 36 deletions(-) > > > +static inline uint32_t > +bsf64(uint64_t v) > +{ > + return (uint32_t)__builtin_ctzll(v); > +} > + > +static inline uint32_t > +log2_u64(uint64_t v) > +{ > + if (v == 0) > + return 0; > + v = rte_align64pow2(v); > + return bsf64(v); > +} > + Can we move this to lib/librte_eal/common/include/rte_common.h? It has already rte_log2_u32()