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 36C72429C5; Sun, 23 Apr 2023 15:24:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03EAF410DE; Sun, 23 Apr 2023 15:24:00 +0200 (CEST) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by mails.dpdk.org (Postfix) with ESMTP id 6665440A80; Sun, 23 Apr 2023 15:23:58 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 30C463200893; Sun, 23 Apr 2023 09:23:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 23 Apr 2023 09:23:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1682256235; x=1682342635; bh=6XFqa70XEF3lkMa+NoZ1QTbUMrKX/zHbkhT AlMBa0yg=; b=D5xVNuoOTkyaNiN2umBDDYPCRd7L0a2TjLKWCN6qg3FMB5PYOMK vjMTpKrMjG6LA77FiUGtdzGrqUTq9OCeLjia9M2yG3ynAagZgmY/WWppg/pFn0YB 1nDlv9YBeh+p2uK/+G89vt9iNgQDB9+LMA3X1TkrT3nzDoMnhzPI0UuQHUfT9uxO 0Qic7OJbNkk/q1z6e4W4S4PU4G0KFREaJ/h8oq0lu1AhqgYGAE0bCm3rt4rft2pU HeGpc8k4LQEUtApj3dKTR58jsgcoO4J+nTAdYnXecTN0d0NtzDHfaJqyjMU/+Tfo BNz/1ere2az/G1Vz236pnH2Ijk/bauH9R8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1682256235; x=1682342635; bh=6XFqa70XEF3lkMa+NoZ1QTbUMrKX/zHbkhT AlMBa0yg=; b=NV4/jevwFx9sSKPeG7R/PAcnAhT8FYkYbQnMazyLli0vvhTJSDJ MnUS2yiQ0BMEgrnV7Rv3jfrdts4f+oV/O7MvoUWbq6WPG+TYiOctHhzLrHfN2jMK WduJ+8KgCVcVDk/T9u3zmYz7tMoogyjPYjVkhLt0WlfEFVSJ9a4yHjJeoUvTBEtg k7u7MOIoFH0TGcCYfQKMzNnLYL6o/SnA3LimIOcFnAJpWDqKZnChiQg+IaUIgRmR KMmcXWGzlno19CfxB7GA4Qv4zbSLQrdPSmVvcvbmYm6slyks5OwRZclEAoD6MnII xS3YIcfqjcWb8Fxet5a/xiOKvvoXMGznp3w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtkedgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeegtddtleejjeegffekkeektdejvedtheevtdekiedvueeuvdei uddvleevjeeujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Apr 2023 09:23:52 -0400 (EDT) From: Thomas Monjalon To: "You, KaisenX" Cc: "dev@dpdk.org" , "Zhou, YidingX" , "david.marchand@redhat.com" , "Matz, Olivier" , "ferruh.yigit@amd.com" , "zhoumin@loongson.cn" , "stable@dpdk.org" , "Richardson, Bruce" , "jerinj@marvell.com" , "Burakov, Anatoly" Subject: Re: [PATCH v5] enhance NUMA affinity heuristic Date: Sun, 23 Apr 2023 15:19:51 +0200 Message-ID: <3642850.RUnXabflUD@thomas> In-Reply-To: References: <20221221104858.296530-1-david.marchand@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 OK please send v6 with comments in the code where appropriate. We'll continue the discussion in v6. Thanks 23/04/2023 10:57, You, KaisenX: >=20 > > -----Original Message----- > > From: You, KaisenX > > Sent: 2023=E5=B9=B44=E6=9C=8823=E6=97=A5 14:52 > > To: Thomas Monjalon > > Cc: dev@dpdk.org; Zhou, YidingX ; > > david.marchand@redhat.com; Matz, Olivier ; > > ferruh.yigit@amd.com; zhoumin@loongson.cn; stable@dpdk.org; > > Richardson, Bruce ; jerinj@marvell.com; > > Burakov, Anatoly > > Subject: RE: [PATCH v5] enhance NUMA affinity heuristic > >=20 > >=20 > >=20 > > > -----Original Message----- > > > From: Thomas Monjalon > > > Sent: 2023=E5=B9=B44=E6=9C=8821=E6=97=A5 16:13 > > > To: You, KaisenX > > > Cc: dev@dpdk.org; Zhou, YidingX ; > > > david.marchand@redhat.com; Matz, Olivier ; > > > ferruh.yigit@amd.com; zhoumin@loongson.cn; stable@dpdk.org; > > > Richardson, Bruce ; jerinj@marvell.com; > > > Burakov, Anatoly > > > Subject: Re: [PATCH v5] enhance NUMA affinity heuristic > > > > > > 21/04/2023 04:34, You, KaisenX: > > > > From: Thomas Monjalon > > > > > 13/04/2023 02:56, You, KaisenX: > > > > > > From: You, KaisenX > > > > > > > From: Thomas Monjalon > > > > > > > > > > > > > > > > I'm not comfortable with this patch. > > > > > > > > > > > > > > > > First, there is no comment in the code which helps to > > > > > > > > understand the > > > > > logic. > > > > > > > > Second, I'm afraid changing the value of the per-core > > > > > > > > variable _socket_id may have an impact on some applications. > > > > > > > > > > > > > > Hi Thomas, I'm sorry to bother you again, but we can't think of > > > > > > a better solution for now, would you please give me some > > > > > > suggestion, and > > > > > then I will modify it accordingly. > > > > > > > > > > You need to better explain the logic both in the commit message > > > > > and in code comments. > > > > > When it will be done, it will be easier to have a discussion with > > > > > other maintainers and community experts. > > > > > Thank you > > > > > > > > > Thank you for your reply, I'll explain my patch in more detail next. > > > > > > > > When a DPDK application is started on only one numa node, > > > > > > What do you mean by started on only one node? > > When the dpdk application is started with the startup parameter "-l 40-= 59" > > (this range is on the same node as the system cpu processor).Only memor= y is > > allocated for this node when the process is initialized. > > > > > > > memory is allocated for only one socket. > > > > When interrupt threads use memory, memory may not be found on the > > > > socket where the interrupt thread is currently located, > > > > > > Why interrupt thread is on a different socket? > > The above only allocates memory on node1, but the interrupt thread is > > created on node0. > > Interrupt threads are created by > > rte_ctrl_thread_create() ,rte_ctrl_thread_create()' > > does NOT run on main lcore, it can run on any core except data plane co= res. > > So interrupt thread can run on any core. > To avoid ambiguity, I'll explain my commet again. Interrupt threads are c= reated by > rte_ctrl_thread_create() , rte_ctrl_thread_create() doesn't control which= node the=20 > thread it creates runs on, interrupt threads can run on any core except d= ata plane=20 > cores. So interrupt thread can run on any core. > > > > and memory has to be reallocated on the hugepage, this operation can > > > > lead to performance degradation. > > > > > > > > So my modification is in the function malloc_get_numa_socket to make > > > > sure that the first socket with memory can be returned. > > > > > > > > If you can accept my explanation and modification, I will send the > > > > V6 version to improve the commit message and code comments. > > > > > > > > > > > Thank you for your reply. > > > > > > > First, about comments, I can submit a new patch to add > > > > > > > comments to help understand. > > > > > > > Second, if you do not change the value of the per-core > > > > > > > variable_ socket_ id, /lib/eal/common/malloc_heap.c > > > > > > > malloc_get_numa_socket(void) > > > > > > > { > > > > > > > const struct internal_config *conf =3D > > > eal_get_internal_configuration(); > > > > > > > unsigned int socket_id =3D rte_socket_id(); // The = return value of > > > > > > > "rte_socket_id()" is 1 > > > > > > > unsigned int idx; > > > > > > > > > > > > > > if (socket_id !=3D (unsigned int)SOCKET_ID_ANY) > > > > > > > return socket_id; //so return here > > > > > > > > > > > > > > This will cause return here, This function returns the > > > > > > > socket_id of unallocated memory. > > > > > > > > > > > > > > If you have a better solution, I can modify it. > > > > > > > > > >=20 >=20