From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 33C79A0679 for ; Tue, 2 Apr 2019 18:13:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A3E864F93; Tue, 2 Apr 2019 18:13:11 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id B6A0F4C9C; Tue, 2 Apr 2019 18:13:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2019 09:13:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,301,1549958400"; d="scan'208";a="333084021" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.103]) ([10.237.220.103]) by fmsmga006.fm.intel.com with ESMTP; 02 Apr 2019 09:13:05 -0700 To: Shahaf Shuler , thomas@monjalon.net Cc: dev@dpdk.org, stable@dpdk.org, alejandro.lucero@netronome.com References: <20190321202156.117496-1-shahafs@mellanox.com> <20190331084348.4740-1-shahafs@mellanox.com> From: "Burakov, Anatoly" Message-ID: <0ccaf7f1-e10c-de6a-1219-76ce6e76119f@intel.com> Date: Tue, 2 Apr 2019 17:13:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190331084348.4740-1-shahafs@mellanox.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] mem: limit use of address hint 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190402161305.yvmcYS4tMxEA32FcCRQwBAb1PQB7qJMWJYlGfi0od0I@z> On 31-Mar-19 9:43 AM, Shahaf Shuler wrote: > patch[1] added an address hint as starting address for 64 bit systems in > case an explicit base virtual address was not set by the user. > > The justification for such hint was to help devices that work in VA > mode and has a address range limitation to work smoothly with the eal > memory subsystem. > > While the base address value selected may work fine for the eal > initialization, it easily breaks when trying to register external memory > using rte_extmem_register API. > > Trying to register anonymous memory on RH x86_64 machine took several > minutes, during them the function eal_get_virtual_area repeatedly > scanned for a good VA candidate. > > The attempt to guess which VA address will be free for mapping will > always result in not portable, error prone code: > * different application may use different libraries along w/ DPDK. One > can never guess which library was called first and how much virtual > memory it consumed. > * external memory can be registered at any time in the application run > time. > > In order not to break the existing secondary process design, this patch > only limits the max number of tries that will be done with the > address hint. > When the number of tries exceeds the threshold the code > will use the suggested address from kernel. > > Fixes: 1df21702873d ("mem: use address hint for mapping hugepages") > Cc: stable@dpdk.org > Cc: alejandro.lucero@netronome.com > > [1] commit 1df21702873d ("mem: use address hint for mapping hugepages") > > Signed-off-by: Shahaf Shuler > --- > > On v2: > * instead of a complete remove of the hint limit the number of tries we allow. > --- LGTM Tested-by: Anatoly Burakov We can always increase the number of tries later :) -- Thanks, Anatoly