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 1C65D42B1C; Tue, 16 May 2023 07:20:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A11A540C35; Tue, 16 May 2023 07:20:01 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id A6B6F40A7A; Tue, 16 May 2023 07:19:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684214400; x=1715750400; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vDM652qQWW1vcMAjSdDnziys/F7Ct2DmFyPCEquJA2k=; b=iuVtOWkNFbgbgzN3JN+0xwjRBg7CQPAKaEZjrU9LTd/lRc7LgionU1YE IpKDY0Y+TrYHaAeeTavGw7q1z6+IsgMemDS9JLgXb+zMKaduuE3+LsE38 xX6G0Rzg9o7VTqR7bp/76FvekFXlAls5GUGWSSAXFsEbucN/kcUYZ7gpe lrUVupfI52OhhxeYJa4Su80RCNwib1Qz0be0E9WmarXIincPjqFz8zZoC pNNRQ7MFKCo2k1T6A52+1Vu0MBLvCBhWR+YPuufD6DEwFs4Tp7DwUXYLY N/vC7h9ml7Mf5XEVFZFeu/k+fj6czJk6uCzwWu8gdD79MtHKFCXVROnfr g==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="348884302" X-IronPort-AV: E=Sophos;i="5.99,277,1677571200"; d="scan'208";a="348884302" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2023 22:19:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="825428353" X-IronPort-AV: E=Sophos;i="5.99,277,1677571200"; d="scan'208";a="825428353" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 15 May 2023 22:19:57 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 15 May 2023 22:19:57 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 15 May 2023 22:19:56 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Mon, 15 May 2023 22:19:56 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Mon, 15 May 2023 22:19:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7oREIMWDA6PlWP/0o7krjjRVK2D6dK41VlZB6p+JjHZfXmkbzPLkwlHRU1sV496c1+DHfyeAsgenCrG5c4JPcOjt5MLVt0Bm0Y6bZ3UOi5ZLH3rmTAHKadnIBemsNcwerFP3LkM7qYY4JSEqU1ntc4hgHuBdqdvd+9KojoqaxPu9uclVm/ANqAaMP1t38Zu1x+Vu/3gUPGcd9apLfzdjhp2nhw2XpIwkQqmaSLGW9IuCbQmuRbwzItP8fE6zi0Eq7LopeaD4170h+vu2xM2akG5KGwYD3UiaSSsPDsBpCVlBIbI9PpA/+7EjBPewA+0iMjpCxzCWFNPO5oIJHsVtA== 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=ONSFR/beH2Y9zEQAjttA62iCRQO1J4q9rpYygV9IMII=; b=ImGpaeUx2ytjUi1nWTR/yRSiYL8XhWVYDwCNRlH5fTtGFaFstz4oV713gq4ejMTP3B/t2nW3gDPlDn/eTfal/ynbdTCLbeWPtAOSoUhXvYE49jgwxE7VjG1TIqHYErwvnLoryk08DVBHjldrq1Y1p76u4PyawUAj+aSs6m9LLfsmJ3MIhSSMRbQ0Evw4LGYDAd6kwacuEi4uN4xHNG+TtVBEpVxMnRBqLqwVYiIZsQRxp5zElV73jNd92cfCnQvJfiuL1HQoi6VMmvYfCg5wL+OHddPzqFYSBA6C1LGc+36dWF1U739Z1xA+LkZrv+K03sj+3ue5yLgfSCtPlcpYdA== 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 PH7PR11MB6835.namprd11.prod.outlook.com (2603:10b6:510:1ee::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 05:19:47 +0000 Received: from SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::d8de:a1e1:f598:6572]) by SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::d8de:a1e1:f598:6572%5]) with mapi id 15.20.6387.030; Tue, 16 May 2023 05:19:46 +0000 From: "You, KaisenX" To: Thomas Monjalon CC: "dev@dpdk.org" , "Zhou, YidingX" , "david.marchand@redhat.com" , "Matz, Olivier" , "ferruh.yigit@amd.com" , "Burakov, Anatoly" , "stable@dpdk.org" Subject: RE: [PATCH v6] enhance NUMA affinity heuristic Thread-Topic: [PATCH v6] enhance NUMA affinity heuristic Thread-Index: AQHZdzgPsrwMvJCE3UCI7/3jmJMuXK8+vL6AgB3AVQA= Date: Tue, 16 May 2023 05:19:46 +0000 Message-ID: References: <20230201122048.1283392-1-kaisenx.you@intel.com> <20230425051649.1109428-1-kaisenx.you@intel.com> <10927439.BaYr0rKQ5T@thomas> In-Reply-To: <10927439.BaYr0rKQ5T@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_|PH7PR11MB6835:EE_ x-ms-office365-filtering-correlation-id: aa34fb8f-146f-4606-4811-08db55cd29ff 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: OMFuRWFImtOgwZq6bYn/qKCsoESWZVlq7iF/Y1PAusKN+rnKuuRlFLKhE/VLg53NHUZaxLI8aVamWhJTBdaXk+/DGwoKVQZUFJ7o4DfvvD/N/B1kZ6A52M5IiH8zKaHcEoZw8pT7jZjVzmDrAJ5hDXQoincZZVJCIMFIsEmJheXuCQbm+/rmVm3qixgOvc5vrnSEcKRvkIsBGkOAENQG7qsWyVOjWcbH0McABAiu3Qk2esklUjMRTTX1IyYngj+yKzxXoBz5EPMoI/JSST+51GlVPdqTZSq5EpXcPQMs+CY7/1gQI4sEJERHCidS8UnLFns1rJkcOx/1/mK0cuP1HchET8eZw2vH1iaoON2Ea+6E5ZnAjkM76CRqtbV3Tw1Atzv7DpOz9R8IN6i/V53Hv7+frOGrCet1O9TUHOY/XkqRzm1TjeXJRsRXKEO1nek1zq/swt5Ytb7XgSu8JSfT6vlhDjEtad5k5eSmw/tm9DltQtZYd5uv3DRfJe2/fgVdQsMTydUC4QTcrYiJ3cjLhwXBHlmbCx1v8/QfSWISqC/9c69im3IcnMBVqBXitaITaPJG/v9nScmUHFJ6U2W1hU1xT+Uj5nVV4XF5WW/LRZeA1Oe9ZIS7JTk8CqqtwuWB 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)(39860400002)(396003)(366004)(346002)(136003)(376002)(451199021)(33656002)(54906003)(316002)(66946007)(66556008)(478600001)(6916009)(66476007)(4326008)(64756008)(66446008)(86362001)(76116006)(7696005)(55016003)(8676002)(5660300002)(8936002)(52536014)(82960400001)(2906002)(38070700005)(122000001)(41300700001)(38100700002)(83380400001)(53546011)(186003)(26005)(9686003)(6506007)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?eUwybHNIR3pYZUdWcEZnWWhpWHV4N3grMjZ1SE56bFkxWXdscG50U2dV?= =?iso-2022-jp?B?R09LT0k3OWpGbUNYc1ZkaFdRTnFWQnVzZDV4WGk5Y3kvUW9jMjVvVXJh?= =?iso-2022-jp?B?UzlQVTAzelpEY1pRaUlwWmpJRUdRNGpJeFA3UzFPanJVUzBRc0tIckJJ?= =?iso-2022-jp?B?VXRjRFI5YXdsMVkwVVNtNnN1cnJnbnBuODAyUkFvMFpQa3dDQVAxVS80?= =?iso-2022-jp?B?SmFXaTVtY25na3hSYTJTc0dpSkQ0RVpWNjN3T21xSFNxM3lTWjNLZnlp?= =?iso-2022-jp?B?eFhDTmdvTmN1WXhYeVpMbWtCcXUyYXgrS2tSWE9YV3dzNm1vYlhoamZm?= =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3RkYnNwNWJTUWJTWUp6SkxKVlYw?= =?iso-2022-jp?B?dytvcmtCT0pzcjI2YytOTDhqRm9aeHZxcXVpQmNPRHRVaWtKRzZYekxm?= =?iso-2022-jp?B?NnRKTmk4S1YwWStoMi8vTytsNFRWZFZlbUp5Wm9Sa3h4NXVGNm4vWVdE?= =?iso-2022-jp?B?d01PbQ==?= 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: aa34fb8f-146f-4606-4811-08db55cd29ff X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2023 05:19:46.3953 (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: 3zxeGYEs53ighLVYN3pnxng8RR3zOTZsDbJFS0pBb0/7GJeFDUAVCXh3EzsW+mbPDKJmXzlxOw4ZuQC0/4Z7zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6835 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(B27=1B$BF|=1B(B 14:58 > To: You, KaisenX > Cc: dev@dpdk.org; Zhou, YidingX ; > david.marchand@redhat.com; Matz, Olivier ; > ferruh.yigit@amd.com; Burakov, Anatoly ; You, > KaisenX ; stable@dpdk.org > Subject: Re: [PATCH v6] enhance NUMA affinity heuristic >=20 > 25/04/2023 07:16, Kaisen You: > > Trying to allocate memory on the first detected numa node,it has less > > chance to find some memory actually available rather than on the main > > lcore numa node (especially when the DPDK application is started only > > on one numa node). >=20 > You didn't change the explanations here as discussed previously. >=20 > > > > Fixes: 8b0a1b8cb481 ("eal: stop using pthread for lcores and control > > threads") > > Fixes: 770d41bf3309 ("malloc: fix allocation with unknown socket ID") > > Cc: stable@dpdk.org > > > > Signed-off-by: David Marchand > > Signed-off-by: Kaisen You > > > > --- > > Changes since v5: > > - Add comments to the code, > > > > Changes since v4: > > - mod the patch title, > > > > Changes since v3: > > - add the assignment of socket_id in thread initialization, > > > > Changes since v2: > > - add uncommitted local change and fix compilation, > > > > Changes since v1: > > - accomodate for configurations with main lcore running on multiples > > physical cores belonging to different numa, > > --- > > lib/eal/common/eal_common_thread.c | 4 ++++ > > lib/eal/common/malloc_heap.c | 6 ++++++ > > 2 files changed, 10 insertions(+) > > > > diff --git a/lib/eal/common/eal_common_thread.c > > b/lib/eal/common/eal_common_thread.c > > index 079a385630..d65bfe251b 100644 > > --- a/lib/eal/common/eal_common_thread.c > > +++ b/lib/eal/common/eal_common_thread.c > > @@ -252,6 +252,10 @@ static int ctrl_thread_init(void *arg) > > struct rte_thread_ctrl_params *params =3D arg; > > > > __rte_thread_init(rte_lcore_id(), cpuset); > > + /* set the value of the per-core variable _socket_id. > > + * Convenient for threads to find memory. > > + */ >=20 > That's an useless comment. > We want to know WHY you are setting to SOCKET_ID_ANY. >=20 > > + RTE_PER_LCORE(_socket_id) =3D SOCKET_ID_ANY; > > params->ret =3D rte_thread_set_affinity_by_id(rte_thread_self(), > cpuset); > > if (params->ret !=3D 0) { > > __atomic_store_n(¶ms->ctrl_thread_status, > > diff --git a/lib/eal/common/malloc_heap.c > > b/lib/eal/common/malloc_heap.c index d25bdc98f9..a624f08cf7 100644 > > --- a/lib/eal/common/malloc_heap.c > > +++ b/lib/eal/common/malloc_heap.c > > @@ -716,6 +716,12 @@ malloc_get_numa_socket(void) > > if (conf->socket_mem[socket_id] !=3D 0) > > return socket_id; > > } > > + /* Trying to allocate memory on the main lcore numa node. > > + * especially when the DPDK application is started only on one numa > node. > > + */ > > + socket_id =3D rte_lcore_to_socket_id(rte_get_main_lcore()); > > + if (socket_id !=3D (unsigned int)SOCKET_ID_ANY) > > + return socket_id; >=20 > You should explain why we could reach this point, i.e. SOCKET_ID_ANY. I'm sorry I didn't reply to you in time due to COVID-19 infection, I will s= end the v7=20 version as soon as possible to fix the problem you mentioned. >=20 > > > > return rte_socket_id_by_idx(0); > > } >=20 >=20