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 AE459429AA; Fri, 21 Apr 2023 10:12:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A13E4410F3; Fri, 21 Apr 2023 10:12:59 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id E7A95410DD; Fri, 21 Apr 2023 10:12:57 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 55F435C00D6; Fri, 21 Apr 2023 04:12:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 21 Apr 2023 04:12: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= 1682064777; x=1682151177; bh=k5EDp0YofJWLuaa9PV0X6MA+tkE6CMTmOS+ MgNLNx1w=; b=IEbNDFt4QgCgmkCMPHaZzmhh6Ip8rvYC8oJZC3cOpHW2gruaOxf diyg0ira7uTGfD5xpc/08sAf9YvFyYAX6iFZ0iuruAkUj2uy2BOoD8mU31Qz1ITy Dp0j1icBRMUchKlSM/GxuCaTbw3S+MOLWmz8p1lCOaErDP2lC0aK3dzVgCNnrlIT KHht534fb+IJ3zEZtt/KR+niG6AIdcL+LW63MAqUhBCj7Cpowh6Iei+kdbrZOR2i URDOE/RiNxjBGUnbajBz5oLKIEKEeQcr0T5IYHJnrw8ct8p13Oa0ZF9pPZH9fWhH eEdOqPLrvdwwVfwdMQhjGtl7yQxHINj/03w== 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= 1682064777; x=1682151177; bh=k5EDp0YofJWLuaa9PV0X6MA+tkE6CMTmOS+ MgNLNx1w=; b=jeYSDFUy8H1rIIC8FBynPC05N9AdqWuYhQYlq3ym787452n/LyH cyZt/5O01iqolDxdTNaawp5RHrEfBChXG+xHyIm/FN6R58+bceWOwHs2N4WyxOUe FmmTNOSaN1XIbvnFpd744jeoOyuiP7d8fOT5wvKlrzsjz+SfeetFRjCgbW6zhHYl /UfR8Nn0uxFCffbTGjvnlHtr0pM+x6OjQWU01BWYToHExKY7CuQNPVlmLdm9Bzmz oI1VyjIYHE3P34ofIMnjRE5Y4JJAqKobDhSBGo9mTEgbnNHEcQgLfBqWwichgfAq p8eRW05jwngTRkfZRmqL3g88+lbhg8qAy5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtgecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrf grthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieekgfek udehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Apr 2023 04:12:55 -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: Fri, 21 Apr 2023 10:12:53 +0200 Message-ID: <3535353.LM0AJKV5NW@thomas> In-Reply-To: References: <20221221104858.296530-1-david.marchand@redhat.com> <3549930.R56niFO833@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 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? > 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? > 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 = eal_get_internal_configuration(); > > > > unsigned int socket_id = rte_socket_id(); // The return value of > > > > "rte_socket_id()" is 1 > > > > unsigned int idx; > > > > > > > > if (socket_id != (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.