From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jonas Pfefferle" Subject: Re: [PATCH] mem: warn if address hint is not respected Date: Wed, 03 Jan 2018 10:55:09 +0100 Message-ID: References: <1509440909-8068-1-git-send-email-jpf@zurich.ibm.com> <10656029.OGFJoE0f1c@xps> <55afaf0a-14cc-11b0-c7ec-21ea1bc2403f@intel.com> Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8; format="flowed" Content-Transfer-Encoding: 8bit Cc: "dev@dpdk.org" , "jianfeng.tan@intel.com" , "Thomas Monjalon" To: "Xueming(Steven) Li" , "Burakov, Anatoly" Return-path: Received: from gozo.iway.ch (gozo.iway.ch [212.25.24.36]) by dpdk.org (Postfix) with ESMTP id 317D51B1B7 for ; Wed, 3 Jan 2018 10:55:11 +0100 (CET) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" I don't believe that it would work since you cannot assume that mmap addresses will just increase. Especially with ASLR anything can happen. I don't understand why you want to get rid of --base-virtaddr I think it is a valid solution for the problem. On Wed, 3 Jan 2018 09:37:00 +0000 "Xueming(Steven) Li" wrote: > So the idea of item 3 might sound and lead to seldom usage of >'--base-virtaddress'. > Reserve an address hole big enough before hugepage almost cost >nothing. > >> -----Original Message----- >> From: Jonas Pfefferle [mailto:pepperjo@japf.ch] >> Sent: Wednesday, January 3, 2018 5:22 PM >> To: Xueming(Steven) Li ; Burakov, Anatoly >> >> Cc: dev@dpdk.org; jianfeng.tan@intel.com; Thomas Monjalon >> >> Subject: Re: [dpdk-dev] [PATCH] mem: warn if address hint is not >>respected >> >> Hi Xueming, >> >> Correct --base-virtaddr was introduced for that purpose. There are >> multiple reasons why the address layout of the secondary process >>might >> look different: reasons you mentioned in 2), ASLR etc. I believe >>there is >> no way to avoid this in real world use cases. The reason for this >> particular patch is that the address hint (--base-virtaddr) is >>sometimes >> not respected and the kernel falls back to just reserving any >>address it >> can find to satisfy the mapping (see discussion on the patch), i.e. >> effectively rendering --base-virtaddr useless. >> >> Regards, >> Jonas (new email address) >> >> >> On Tue, 26 Dec 2017 15:56:10 +0000 >> "Xueming(Steven) Li" wrote: >> > Hi Jonas, >> > >> > Seems you are trying to use --base-virtaddr to resolve address >> >conflicts in secondary, I'm wondering how this happened and how to >> >avoid it: >> > 1. what's your hugepage side? Hugepage mmap is size aligned, maybe >>1G >> >works? >> > 2. is there more libs loaded in secondary process or memory usage >> >before EAL init? >> > 3. Since address allocated in one direction, I'm thinking to >>reserve a >> >larger "hop" address space as MAP_ANONYMOUS, allocate hugepage, >>then >> >release "hop". That essentially reserve an address space big >>enough >> >for secondary, and most important the hop size is easy to estimate >> >than --base-virtaddr. >> > >> > Thanks, >> > Xueming(Steven) >> > >> >> -----Original Message----- >> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jonas >> >>Pfefferle1 >> >> Sent: Wednesday, November 8, 2017 7:52 PM >> >> To: Burakov, Anatoly >> >> Cc: dev@dpdk.org; jianfeng.tan@intel.com; Thomas Monjalon >> >> >> >> Subject: Re: [dpdk-dev] [PATCH] mem: warn if address hint is not >> >>respected >> >> >> >> "Burakov, Anatoly" wrote on >>11/07/2017 >> >> 02:54:24 >> >> PM: >> >> >> >> > From: "Burakov, Anatoly" >> >> > To: Thomas Monjalon >> >> > Cc: dev@dpdk.org, Jonas Pfefferle , >> >> jianfeng.tan@intel.com >> >> > Date: 11/07/2017 02:54 PM >> >> > Subject: Re: [dpdk-dev] [PATCH] mem: warn if address hint is >>not >> >> respected >> >> > >> >> > On 06-Nov-17 8:26 PM, Thomas Monjalon wrote: >> >> > > 31/10/2017 10:08, Jonas Pfefferle: >> >> > >> Print a warning if the --base-virtaddr hint is not respected >> >>since >> >> > >> this might lead to problems when mapping memory in the >> >>secondary >> >> > >> process. >> >> > >> >> >> > >> Signed-off-by: Jonas Pfefferle >> >> > > >> >> > > Anatoly, please review this patch. >> >> > > It does not seem to fix something, so it is candidate for >>18.02. >> >> > > >> >> > >> >> > For some reason my Thunderbird ate the original email, so i'll >> >>reply >> >> > to this one. >> >> > >> >> > One nitpick would be that we're calling get_virtual_area many >> >>times >> >> > and it would probably be a good idea to make pagesize static >>and >> >>call >> >> > sysconf only once. Otherwise, >> >> >> >> We should address this in a separate patch and introduce a >>pagesize >> >>function for everyone to use. sysconf is used like this all over >>the >> >>place. >> >> >> >> > >> >> > Acked-by: Anatoly Burakov >> >> > >> >> > -- >> >> > Thanks, >> >> > Anatoly >> >> > >