From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D82F42C54; Wed, 7 Jun 2023 22:32:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2121241611; Wed, 7 Jun 2023 22:32:56 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0E1B0410D0 for ; Wed, 7 Jun 2023 22:32:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686169974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l6hdN3FrCKoA+H22Hd8fI6iHQA1GFU+iQdvjQXM+OJ8=; b=dO04QSDDucCc1ZWCDcd1QQVtUkBrpi69nqNPTCoILi6iScQH1p3UL3FpV8EH2PDAGw/Znk 8m3GqPEwn5WOhviT8Y82nItBREIu8ocSkWQyN8kS5E2TB6DhQnlr9cHvULJbb8L8CgrB9M eK2cU1z8ddiAbJbA8nLfio1E/3Xwi5w= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-25-Ek_0HsxqOEeB3f5cWeNyjw-1; Wed, 07 Jun 2023 16:32:53 -0400 X-MC-Unique: Ek_0HsxqOEeB3f5cWeNyjw-1 Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-25632c99f06so2484244a91.0 for ; Wed, 07 Jun 2023 13:32:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686169972; x=1688761972; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l6hdN3FrCKoA+H22Hd8fI6iHQA1GFU+iQdvjQXM+OJ8=; b=GnTfBO1lVqL94p92WPw71RXDvBr7XgKBsG3EMCRd+sWFHRKRLLAER7rxv3bDIxzEDC lQr7+q5Ix1SIH0D58OcIjw3k0nRhHEsRAhsFTyBEeM/QMt6BQHZUB21Y5LIXPq7gcwrp bcQVb6mQ2RoTb2Y3esxxcZPmj2NIRJA+x9k1L1loiLaAjENS6EM5HpKXaSaMKJyWLrXb uDf4NVEGpvr8pzLoD6YJxhYpJKrbVQvMVJqWLiUHH+Xqp59Afk7vDybS9ElX1wUtWn12 IjqnwKbwmJhf2AG8AdJ7hRdnzVikBmX05ogwpmUYhyB2w6oH4WW2XjIO7yMFhkqEVtJb DzPQ== X-Gm-Message-State: AC+VfDwN4YWNBUHbQfUfH7InPqRaEq4/K9tN0rf8OudEicGDQQN4UgZh AF5hOax00g18PAdP4asXp/x2TmcSguGEm29tWAdeITKSISnkbgxDVedG+CYeeYkKnSPpSINa9bS RLx+4FafbDSgc4UOi0oE= X-Received: by 2002:a17:90a:a78e:b0:253:572f:79b2 with SMTP id f14-20020a17090aa78e00b00253572f79b2mr2367325pjq.36.1686169972219; Wed, 07 Jun 2023 13:32:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5U6NcWs2QpBvGlKXFcCS5QTdMoXQIz3AZMVG6EhDF66pmb9I4uXYomAQJXUDu2HU5l1X0146KvvqcAoZxn9/c= X-Received: by 2002:a17:90a:a78e:b0:253:572f:79b2 with SMTP id f14-20020a17090aa78e00b00253572f79b2mr2367311pjq.36.1686169971963; Wed, 07 Jun 2023 13:32:51 -0700 (PDT) MIME-Version: 1.0 References: <20230529112130.11198-1-changfengnan@bytedance.com> In-Reply-To: <20230529112130.11198-1-changfengnan@bytedance.com> From: David Marchand Date: Wed, 7 Jun 2023 22:32:40 +0200 Message-ID: Subject: Re: [PATCH v4] eal: fix eal init may failed when too much continuous memsegs under legacy mode To: Fengnan Chang , Lin Li Cc: anatoly.burakov@intel.com, dev@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, May 29, 2023 at 1:23=E2=80=AFPM Fengnan Chang wrote: > > Under legacy mode, if the number of continuous memsegs greater > than RTE_MAX_MEMSEG_PER_LIST, eal init will failed even though > another memseg list is empty, because only one memseg list used > to check in remap_needed_hugepages. > Fix this by make remap_segment return how many segments mapped, > remap_segment try to map most contiguous segments it can, if > exceed it's capbility, remap_needed_hugepages will continue to > map other left pages. > > For example: > hugepage configure: > cat /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepage= s > 10241 > 10239 > > startup log: > EAL: Detected memory type: socket_id:0 hugepage_sz:2097152 > EAL: Detected memory type: socket_id:1 hugepage_sz:2097152 > EAL: Creating 4 segment lists: n_segs:8192 socket_id:0 hugepage_sz:209715= 2 > EAL: Creating 4 segment lists: n_segs:8192 socket_id:1 hugepage_sz:209715= 2 > EAL: Requesting 13370 pages of size 2MB from socket 0 > EAL: Requesting 7110 pages of size 2MB from socket 1 > EAL: Attempting to map 14220M on socket 1 > EAL: Allocated 14220M on socket 1 > EAL: Attempting to map 26740M on socket 0 > EAL: Could not find space for memseg. Please increase 32768 and/or 65536 = in > configuration. > EAL: Couldn't remap hugepage files into memseg lists > EAL: FATAL: Cannot init memory > EAL: Cannot init memory We are missing a Fixes: tag and this is backport material, right? > > Signed-off-by: Fengnan Chang > Signed-off-by: Lin Li Can I update Lin Li existing entry in .mailmap? Or is this a different pers= on? > Signed-off-by: Burakov Anatoly Anatoly Burakov* > Reviewed-by: Anatoly Burakov Strange to have both SoB and Review tag from Anatoly. > --- > lib/eal/linux/eal_memory.c | 51 +++++++++++++++++++++++++++----------- Is this issue affecting only Linux? --=20 David Marchand