From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 980E31BE4E; Tue, 3 Jul 2018 12:47:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2018 03:46:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,303,1526367600"; d="scan'208";a="69261082" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.109]) ([10.237.220.109]) by fmsmga001.fm.intel.com with ESMTP; 03 Jul 2018 03:46:52 -0700 To: Alejandro Lucero Cc: dev , stable@dpdk.org, Maxime Coquelin References: <1530552423-32301-1-git-send-email-alejandro.lucero@netronome.com> <1530552423-32301-5-git-send-email-alejandro.lucero@netronome.com> From: "Burakov, Anatoly" Message-ID: Date: Tue, 3 Jul 2018 11:46:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH 4/6] mem: use address hint for mapping hugepages X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 10:47:02 -0000 On 03-Jul-18 11:44 AM, Alejandro Lucero wrote: > > +               addr = mmap(addr_hint, >                                 (*size) + hugepage_sz, PROT_READ, >   #ifdef RTE_ARCH_PPC_64 >                                 MAP_PRIVATE | MAP_ANONYMOUS | > MAP_HUGETLB, > @@ -286,8 +312,14 @@ >                                 MAP_PRIVATE, >   #endif >                                 fd, 0); > -               if (addr == MAP_FAILED) > +               if (addr == MAP_FAILED) { > +                       /* map failed. Let's try with less memory */ >                         *size -= hugepage_sz; > +               } else if (addr_hint && addr != addr_hint) { > +                       /* map not using hint. Let's try with > another offset */ > > > Comment is slightly misleading - "map not using hint" implies we are > about to map something without using hint. Suggested rewording: > > suggested address hint was not used, try with another offset > > > What about "hint was not used. Try with another offset" ? Works for me :) -- Thanks, Anatoly