From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by dpdk.org (Postfix) with ESMTP id 1BCA32BD8 for ; Fri, 16 Nov 2018 13:49:55 +0100 (CET) Received: by mail-ed1-f68.google.com with SMTP id h15so14771038edb.4 for ; Fri, 16 Nov 2018 04:49:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yc1QiOkY55h3Ir0Oh8eG5T5usTR5gWL5d1hvMJgnC0o=; b=wEdlkH30CwPpeqNQ6aDBEcmQexJuuSQAmV68qG1Z/Z8r4ZHA7C+Hbz2bN1gQ747Atl qx2iage4FtbcP/G1RVJSBKilzpfA85IKA0F1ElS7b30eNrB6DTuBTgmRO7T07eM8g5w9 /94VyTNaqe6ceIrIltUtcDMLZE0eyGUpj/95dfWL+38GwHYLFXJKdnOFaRHkNlk15DPo kHccgfcGlOSDLUDI7ix750fghnUNTpJx/+Gd46mxSf4mo20/eCwAskaHESnTcDsvdq8x a/G5EhM7zN/YTp38Nn1WuDA1e26nPwzCHra/+1qY+TSPpHLRTdDtMYzHYNal85dJfO6S dtBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yc1QiOkY55h3Ir0Oh8eG5T5usTR5gWL5d1hvMJgnC0o=; b=Z73ZHOo7mhkn7spZI0MpBBa7GrWt7DUW0MSaVR9w8H4M+yZJV2bK+hvBGcxxa11mRW 1Vj4mD1aArw9avPlXaIMOlV45jbvS2YLFHxovdH6FrO36vh4Dsl8f2SFKaAW42izZx0X qY6Rf3GeCA5fzfK9coVZn6ciF6C5inpgKxkRE4/pKQPke3RQvUR1/ILmFJefDTWIvaE6 8+xweb5O0UOgTbKPSs8LvjWkSAoq5SuNvmEh9TSKCtXQJfBYvYsPdYHU8GKYU9qgfd1i t8GrfIBjubKwEuByOecYWmBzkyMyXMz+7tAABrzLdttKiyhaZiZDbBCTptXaIra8DSXR rszQ== X-Gm-Message-State: AGRZ1gLIEq2tHbH9GD+ntz2Hz5qfMDLWUY0fDiEfnvE1VQ62ssQnA1Nu Nm3RGuiz4h3HzA9q0IzTmNH+k795FbfBbxQ17oEYvg== X-Google-Smtp-Source: AJdET5f0CTbzVavWjgC9cXn0UCVAz/AFy6ulzjV056aRE9a+PxlQ2D6OK9T1KzI8ED6KzqVGhglSqFzyeW4aqrgMKcg= X-Received: by 2002:aa7:c0d0:: with SMTP id j16mr9341512edp.173.1542372594594; Fri, 16 Nov 2018 04:49:54 -0800 (PST) MIME-Version: 1.0 References: <20181112111819.25087-1-alejandro.lucero@netronome.com> In-Reply-To: From: Alejandro Lucero Date: Fri, 16 Nov 2018 12:49:43 +0000 Message-ID: To: "Burakov, Anatoly" Cc: dev , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 17.11] mem: fix memory initialization time 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: , X-List-Received-Date: Fri, 16 Nov 2018 12:49:55 -0000 On Thu, Nov 15, 2018 at 1:16 PM Burakov, Anatoly wrote: > On 12-Nov-18 11:18 AM, Alejandro Lucero wrote: > > When using large amount of hugepage based memory, doing all the > > hugepages mapping can take quite significant time. > > > > The problem is hugepages being initially mmaped to virtual addresses > > which will be tried later for the final hugepage mmaping. This causes > > the final mapping requiring calling mmap with another hint address which > > can happen several times, depending on the amount of memory to mmap, and > > which each mmmap taking more than a second. > > > > This patch changes the hint for the initial hugepage mmaping using > > a starting address which will not collide with the final mmaping. > > > > Fixes: 293c0c4b957f ("mem: use address hint for mapping hugepages") > > > > Signed-off-by: Alejandro Lucero > > --- > > Hi Alejandro, > > I'm not sure i understand the purpose. When final mapping is performed, > we reserve new memory area, and map pages into it. (i don't quite > understand why we unmap the area before mapping pages, but it's how it's > always been and i didn't change it in the legacy code) > > Which addresses are causing the collision? > > Because the hint for the final mapping is at 4GB address, and the hugepages are initially individually mapped starting at low virtual addresses, when the memory to map is 4GB or higher, the hugepages will end using that hint address and higher. The more the hugepages to mmap, the more addresses above the hint address are used, and the more mmaps failed for getting the virtual addresses for the final mmap. > -- > Thanks, > Anatoly >