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 057D1429A4; Fri, 21 Apr 2023 04:34:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B643410DD; Fri, 21 Apr 2023 04:34:09 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 4647140E6E; Fri, 21 Apr 2023 04:34:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682044447; x=1713580447; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=wQna+JpkVC1GN6ilRKySS+bYhH7uY169kni6zbnejXc=; b=W5QSH1/OicNnXqtKAhrYCWxXP4V0fJPkDoCKpOZFMp0vbBIrdkVnDQNS Uszg3XmjnN+lYmhlPFMwxYXH6kF1A1qgygUAlpJqUXSSQHcmsY6WG61ub Z8UJiQhR9Fy4bigb4kU/84y0UzzZPlmk4IX9XUxQzPjC0Cr95Mc9iOCyq cU2ziBWL4lRTl1q/elbX9O5m7GCixof6Lhu8efE5Mfzexlpzu5L9sU2he 35ZBbfYZErLvgHaSAzOmXulXXYbyjXyvq0wt+x+Yh1PfYpre3GLVmwdi2 f9d4qFb00F0oTx+tz+bRTSZTghN2f4Tw5YVRQLxuAKq0z5LAbO2kwAFwO A==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="345917364" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="345917364" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 19:34:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="816259242" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="816259242" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP; 20 Apr 2023 19:34:05 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Apr 2023 19:34:05 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Apr 2023 19:34:04 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 20 Apr 2023 19:34:04 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.40) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 20 Apr 2023 19:34:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MErfq2PWORlmZfXgAnNDFrzkxiXg2w0pCzyrjZClkIr6ae8xW3z42gP1p15Iudct4WZXlP3vaaC7FolXatF6PlrF8SEInkr+MGIzDGTU/bvFlTV+0O/quHqxrU9eyvvyjdk1r38iLR9/CbLtzcRXr481n9OXkOfneSLT8QCRSM4umelGpUAuWwgfJnLwyFsJe+yp5bZECEqhLXBIAOBNjONgxXdRvVAIB3BvlLe/KkbDFv1HvTNGtzIhWmdjYB4bFd+ZJeiODr0jNVmeAG8xuRtKdIo//N0lPOfUCnzOJF2m3xfbZzPCT/n+DFY2Olc5qc4ZKovEnZx8t4gNz3E04g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ONoSN6JGfq/TTtWdS35hyc/Nd7+cgQFPtOXUnLIBS+w=; b=X1sOcB8qiEWdPPlr3suTyDzd07NfvdqYSkb4rEpRpAlZb/4ub4sVxjlZo2aUjTNFyWkBiInCk/jADp7N/XUVKEGihuG4X4WPqEZ4uZWqwWrsG4lrf5vfDXE2dy14P1Qpm4Ukl72uPdz3ywBCG+HJE07XXe1Ftn5mhf7wfNFoTiy+XLfIUJP03MwIcH3F0md7/4U57WuEm3twWT/zWDun9CzF6K19duPlhTI8NWjLOgAX/+ki0+/aQ9wXb8oWM2GFu6jpExM60gLKCMTA10HTqdv8wXger9aJwKBeEz7x0sUw+/lHnhDhe3XCPi55TlIk8rYAWxrtQnVYvOby2H9LHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SJ0PR11MB6765.namprd11.prod.outlook.com (2603:10b6:a03:47b::10) by DM4PR11MB8226.namprd11.prod.outlook.com (2603:10b6:8:182::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 02:34:01 +0000 Received: from SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::d8de:a1e1:f598:6572]) by SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::d8de:a1e1:f598:6572%3]) with mapi id 15.20.6298.045; Fri, 21 Apr 2023 02:34:01 +0000 From: "You, KaisenX" 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 Thread-Topic: [PATCH v5] enhance NUMA affinity heuristic Thread-Index: AQHZNf9KkwjFirxtKkqXm6ZbKOABl67QJeuAgADH7FCAGFkTAIAInSJQgDb0DOCACi2GgIACffvQ Date: Fri, 21 Apr 2023 02:34:01 +0000 Message-ID: References: <20221221104858.296530-1-david.marchand@redhat.com> <3549930.R56niFO833@thomas> In-Reply-To: <3549930.R56niFO833@thomas> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR11MB6765:EE_|DM4PR11MB8226:EE_ x-ms-office365-filtering-correlation-id: 09eb8470-56b2-42aa-98ef-08db4210ddca x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dRQIr9NOxPO0YaM9i5jQBeOi7K4MYTg+yo2hIVZa5fNbyLdrJLCqWCw0SZBqX60bG10vZ1XHll7Hv1bVQfLCxINgTkc5uGHxqaeu3m1dg72JdVr3qxmIco2ULx+6W5xzflNKCjw6lnUtE70U6RolU+Ogreokww1A0F+4G00wqxWOUF+yp7IwOCApeCxIB5iot2vykX5SY4/zD/OKrspmQz5vzLdNEQt4lfEA/qFDYl4k5eNvo+4woq0A+VGpDwlXTefoFVik1E1g7NrNL8LOuE3pN7GLFy4aph+5jHAdvTPiSxyXybXhYL7tYHq8Z5fLCTZH7YCXBsR+iv/0+E2pZJSY7EFm+4tUf7Uk9mm5tbzbg8S52s+yUt+VauZlfv3fj3EBxjuBBaYYPdMiZG8n5G6eQ1KT2jl3++xiwjJEP0+SgSjrj91Xo7n+yjB2V12KLU+SPIWbXPGx/zkOpdFQE97Hm/T7RKr6UXb3EP41YhylYBecJKFBIrhTYOreL8YJcPqSKMb/N1iKKWi9doNvYt/gRaCV+OwC3ZH5MuX09aD50dWoD7CGhJaSicXPkoi94TXjm6X9em59FMcvfJX1c8ANHp+ACVcP3Pg2vx9sDbL+qA4gl+oIyZqgFOvYh31o x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB6765.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(136003)(346002)(366004)(39860400002)(396003)(451199021)(6916009)(4326008)(316002)(54906003)(66446008)(66476007)(76116006)(66946007)(66556008)(64756008)(186003)(53546011)(9686003)(6506007)(26005)(107886003)(38070700005)(38100700002)(83380400001)(33656002)(8676002)(5660300002)(8936002)(55016003)(41300700001)(478600001)(7696005)(71200400001)(82960400001)(86362001)(52536014)(2906002)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?eS85TzJ6M2lydG50UlNIVzFQMS85eXJXUkJVK1RQT2ZTRTVYMU1pNVY0?= =?iso-2022-jp?B?c2VscXhwbEdoa21XdDhKQk11Z3RqZFJoRTlxSnVxWFZ5cGZHbDVERmhK?= =?iso-2022-jp?B?TXAzbGRPQmdXdUZ5cjBvVlZDcUhsbk95TXUyZ0plY0ZBQS9QVG9neXhZ?= =?iso-2022-jp?B?NE9Tb2d3Sjk2bWk1N2RiT0M4QWdlQlZZNEFYR2dMNmh2WS95YmN6c0kr?= =?iso-2022-jp?B?QmJyT0lBR2wvV3MreThlSGFtbGxFTldKZU05SXVFdkhldDBFaHlmZlRL?= =?iso-2022-jp?B?SzA3W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UEZNUko3?= =?iso-2022-jp?B?NTREVXNNV25UR1E3VGxrWkc0eW5aZGUyUUZUMHhpenlSK2hPZkYySlA0?= =?iso-2022-jp?B?dldKc245S3pLQk1UTGNWYWRTZ00xUWxwOFZsSERiZUJKSzlxSjQxZG1E?= =?iso-2022-jp?B?SWRVczVhU3lzZDg4c3B1TXY3ZHI1dG43L0VtRTlWa3l1QlU5YjU3U2dj?= =?iso-2022-jp?B?TXA1dg==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB6765.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09eb8470-56b2-42aa-98ef-08db4210ddca X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2023 02:34:01.0690 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SYV1dl6xwV82x5VEN3FZjJ6tVj2E2zWjuZDVhmEo5cELT7GdT18o8CjMmlnF7JnEdoybl8NbvDxscL2x2y60fQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB8226 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Thomas Monjalon > Sent: 2023=1B$BG/=1B(B4=1B$B7n=1B(B19=1B$BF|=1B(B 20:17 > 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 >=20 > 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 th= e > 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. >=20 > 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 >=20 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, memory is allocat= ed=20 for only one socket.When interrupt threads use memory, memory may not be fo= und=20 on the socket where the interrupt thread is currently located, and memory h= as to be=20 reallocated on the hugepage, this operation can lead to performance degrada= tion. So my modification is in the function malloc_get_numa_socket to make sure=20 that the first socket with memory can be returned. If you can accept my explanation and modification, I will send the V6=20 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_confi= guration(); > > > unsigned int socket_id =3D rte_socket_id(); // The return v= alue 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 >=20