From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by dpdk.org (Postfix) with ESMTP id 1712F2BB1 for ; Fri, 16 Nov 2018 13:49:55 +0100 (CET) Received: by mail-ed1-f65.google.com with SMTP id a2-v6so19551953edi.5 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=tjm4nZlE0hxckFRFrhokw1lbwh0Yn7jAlZYF1WV60QXVeSD9V9MVXW0pJ/+zdTJ9hA XlfsVblB87neB9mzlf5glzGbZzEZ0m/IBo4oHrCYwVy8Hnxdw3ybavs66Z9WceLVfRtM E3x5wRTUKD6W7how2vAqA2dYtHZAiit9olrVYSy3c9CiL2bI8sc1W2s3VjITUthk/xBO p6hAsU9gx8epnqWGOAPIJV4xWvCecFU5D1uZnGXyn+2ZCaEq9+wiCzHOtWa9OMdDY4N/ 5IlqI3VIP5o9wwVADlBTgnFO7WdbdhifGsrDa2W7pjIR5gxeOr33UMf8kUxYxkCIlhST 2GVw== X-Gm-Message-State: AGRZ1gLOmZFR/JGLp2/ghWn3WdUm9Kh+LBzB0mqFKxigDesN/5rrPxg/ lfi+X10lHPhaCk2+VJi6WzIihlKkIcq4Xyk6PPJ/bA== 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-stable] [dpdk-dev] [PATCH 17.11] mem: fix memory initialization time 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: 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 >