From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH 8/8] mem: support using memfd segments for in-memory mode Date: Fri, 24 Aug 2018 09:56:12 +0100 Message-ID: References: <4e780007ecfc3c1c5e8a249f69236b407d2e98d0.1535041359.git.anatoly.burakov@intel.com> <20180824043900.GA9021@jerin> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: Jerin Jacob Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 864B32C0C for ; Fri, 24 Aug 2018 10:57:48 +0200 (CEST) In-Reply-To: <20180824043900.GA9021@jerin> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 24-Aug-18 5:39 AM, Jerin Jacob wrote: > -----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() > > We can (and i will), unfortunately we cannot do it in this release, due to there already being an rte_bsf64 in rte_bitmap.h, and changing/renaming that API will require a deprecation notice. So, this change will be for 19.02. -- Thanks, Anatoly