From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 11/16] Make --no-huge use mmap instead of malloc Date: Thu, 22 May 2014 15:04:22 +0200 Message-ID: <3221053.j2A63PlkPk@xps13> References: <1400514709-24087-12-git-send-email-anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Anatoly Burakov Return-path: In-Reply-To: <1400514709-24087-12-git-send-email-anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-05-19 16:51, Anatoly Burakov: > This makes it possible to run DPDK without hugepage memory when VFIO > is used, as VFIO uses virtual addresses to set up DMA mappings. > > Signed-off-by: Anatoly Burakov > - addr = malloc(internal_config.memory); > + addr = mmap(NULL, internal_config.memory, PROT_READ | PROT_WRITE, > + MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); Please, could you add a comment to explain why using mmap helps? -- Thomas