From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2018 01:57:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,281,1531810800"; d="scan'208";a="227325233" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.148]) ([10.237.220.148]) by orsmga004.jf.intel.com with ESMTP; 24 Aug 2018 01:56:12 -0700 To: Jerin Jacob Cc: dev@dpdk.org, tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, maxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com References: <4e780007ecfc3c1c5e8a249f69236b407d2e98d0.1535041359.git.anatoly.burakov@intel.com> <20180824043900.GA9021@jerin> From: "Burakov, Anatoly" Message-ID: Date: Fri, 24 Aug 2018 09:56:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180824043900.GA9021@jerin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 8/8] mem: support using memfd segments for in-memory mode 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: Fri, 24 Aug 2018 08:57:49 -0000 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