DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Stojaczyk, DariuszX" <dariuszx.stojaczyk@intel.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 2/2] memalloc: keep in mind a failed MAP_FIXED mmap may still perform an unmap
Date: Fri, 1 Jun 2018 12:41:33 +0000	[thread overview]
Message-ID: <FBE7E039FA50BF47A673AD0BD3CD56A846142C66@HASMSX105.ger.corp.intel.com> (raw)
In-Reply-To: <124961f4-c55f-10e6-7f5c-c0767f3b0bd4@intel.com>


> -----Original Message-----
> From: Burakov, Anatoly
> Sent: Friday, June 1, 2018 1:09 PM
> To: Stojaczyk, DariuszX <dariuszx.stojaczyk@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH 2/2] memalloc: keep in mind a failed MAP_FIXED
> mmap may still perform an unmap
> 
> On 01-Jun-18 1:51 PM, Dariusz Stojaczyk wrote:
> > This isn't documented in the manuals, but a failed mmap(...,
> > MAP_FIXED) may still unmap overlapping regions. In such case, we need
> > to remap these regions back into our address space to ensure mem
> > contiguity.
> > We do it unconditionally now on mmap failure just to be safe.
> >
> > Verified on Linux 4.9.0-4-amd64. I was getting ENOMEM when trying to
> > map in hugetlbfs with no space left, but the previous anonymous
> > mapping was still being removed.
> >
> > Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
> > ---
> 
> Does this also happen with other error values?

The man pages aren't clear on this. It could. I know this patch only remaps the region if errrno == ENOMEM, but we could remap it unconditionally after each failed mmap just as well.  It won't hurt if we remap a region unnecessarily. This was my original intent, but apparently I didn't fully commit my changes before publishing patches here. Uhh, sorry.

D.

> 
> --
> Thanks,
> Anatoly

  reply	other threads:[~2018-06-01 12:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 12:51 [dpdk-dev] [PATCH 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area Dariusz Stojaczyk
2018-06-01 11:00 ` Burakov, Anatoly
2018-06-01 12:22   ` Stojaczyk, DariuszX
2018-06-01 14:59     ` Burakov, Anatoly
2018-06-01 12:51 ` [dpdk-dev] [PATCH 2/2] memalloc: keep in mind a failed MAP_FIXED mmap may still perform an unmap Dariusz Stojaczyk
2018-06-01 11:08   ` Burakov, Anatoly
2018-06-01 12:41     ` Stojaczyk, DariuszX [this message]
2018-06-01 13:37 ` [dpdk-dev] [PATCH 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area Dariusz Stojaczyk
2018-06-01 13:39 ` [dpdk-dev] [PATCH v2 " Dariusz Stojaczyk
2018-06-01 10:24   ` Stojaczyk, DariuszX
2018-06-01 11:14     ` Burakov, Anatoly
2018-06-01 12:59   ` [dpdk-dev] [PATCH v3 " Dariusz Stojaczyk
2018-06-01 12:59     ` [dpdk-dev] [PATCH v3 2/2] memalloc: keep in mind a failed MAP_FIXED mmap may still perform an unmap Dariusz Stojaczyk
2018-06-01 15:07       ` Burakov, Anatoly
2018-06-01 15:06     ` [dpdk-dev] [PATCH v3 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area Burakov, Anatoly
2018-07-12 21:42       ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FBE7E039FA50BF47A673AD0BD3CD56A846142C66@HASMSX105.ger.corp.intel.com \
    --to=dariuszx.stojaczyk@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).