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 E8F7AA0093; Tue, 3 May 2022 15:08:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A562040C35; Tue, 3 May 2022 15:08:33 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 089FA40691 for ; Tue, 3 May 2022 15:08:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651583312; x=1683119312; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=H8aYaDOQ+aAdXtXYm9wjsvQAQzPNVQZmU/ObxjoFfpg=; b=BawL+TGBaRU05GwoVbqW2mM7K4d20zPt3wJr2MZpsKfytoU8ofZXJy34 5Q5VJkZ9snQwpwct1xwXKM9sC20AMHdiVTcLD/8jzajb2XwPZG2GK64Qs qiGk46jRdqT7c/aDbPdOBoshYOr7A8EzN+j7bWtHnZ+BdCphpqXbjn3F2 u8vCXJP3Ot6y+A7k0TSmpdBIEuEaBeEFWWpQ5RBqK8raVYJUP4/iPzg6A OUniMZ6iwfikb7G+gkGBRkOwKXTXtFXHsL3QtttJYUmASN17BHell5HI2 zN3euIZPtegABqAb0spKVn9Yx9wuYAo6XiMAKI495olXyxnzYsqwBp1NN A==; X-IronPort-AV: E=McAfee;i="6400,9594,10335"; a="267626473" X-IronPort-AV: E=Sophos;i="5.91,195,1647327600"; d="scan'208";a="267626473" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2022 06:08:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,195,1647327600"; d="scan'208";a="567631130" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga007.fm.intel.com with ESMTP; 03 May 2022 06:08:30 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 3 May 2022 06:08:30 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 3 May 2022 06:08:30 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 3 May 2022 06:08:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dTxAKkEZnKgscpQmJRFoKFXJmeca5LO0dI+rcbkgt5hRppLjCVfl2HOsSfrn5T5Rr4UBYoZxg7mNrERMBAgS8JHOhsRM3YjwPcxeK/jQ4MleYBGDpRABk713HfD3OIIJrAgvtVRGzSlQosStHY9p3M2f7F+k0FMFeZ/EoVgCDYUWBtRckyFLRPqRkuYzmJM4tqI7hQlODT6hukZqdFz6k/WI6ZLK2Fa6D40Cxn1GDgywlIAHA6mwvE81hlsB60cfvrZmyVSxoOcsD5hMciJpsOb3RUvuluPVmUjsXuaEoMP5tsHCc6eQuPP60IYXSBcZhNmQGDc3QHEVt7v42UjQUQ== 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=U4YddCprBhD6VJyeNBW97XMGYuY0V06T46OOSfRtst0=; b=CCiVBD3vZHDqo3Vv1CVPnuXhGHRvuTzPzQTmILIWdnld6o3l0GxSN+S/CCVV6fbvRA06fQ7MYTusQp5QGt2x/+kUxlA5J2WXBvrRCzeR2gxLoj36SGkzeg7Kr68yKBLn5IWGd7wVkVvc8LFZZyNKvgYFM487MPguc7X3RMQAAVWy3lxcLbpk4kd47By9gCCtoKzCiOk8lSlP9y15QQZZmlOjORuZjtH0PGpWuKBsJtNoJMB2QVIVyt4YZMj5MsywZf7YRQj7VIfDPCZFmtS7np2gSGBM/Ag7DiK1AzDyqisOpTt2YCAla7P02ntLdCwTWFxBmUNLJgvrwHHH0eF9jQ== 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 BYAPR11MB3495.namprd11.prod.outlook.com (2603:10b6:a03:8a::14) by MN2PR11MB3568.namprd11.prod.outlook.com (2603:10b6:208:ee::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Tue, 3 May 2022 13:08:26 +0000 Received: from BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::ac0d:3302:2685:d785]) by BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::ac0d:3302:2685:d785%7]) with mapi id 15.20.5206.024; Tue, 3 May 2022 13:08:26 +0000 From: "Wang, Haiyue" To: Don Wallwork , "dev@dpdk.org" CC: "stephen@networkplumber.org" , "mb@smartsharesystems.com" , "Burakov, Anatoly" , "dmitry.kozliuk@gmail.com" , "Richardson, Bruce" , "Honnappa.Nagarahalli@arm.com" , "nd@arm.com" Subject: RE: [PATCH] eal: allow worker lcore stacks to be allocated from hugepage memory Thread-Topic: [PATCH] eal: allow worker lcore stacks to be allocated from hugepage memory Thread-Index: AQHYXi6Vdj+beEdQUEiHJpLie1fvb60NINCg Date: Tue, 3 May 2022 13:08:26 +0000 Message-ID: References: <20220502141058.12707-1-donw@xsightlabs.com> In-Reply-To: <20220502141058.12707-1-donw@xsightlabs.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 648a2472-d49e-4ece-9949-08da2d0602ab x-ms-traffictypediagnostic: MN2PR11MB3568:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OWKpWbUeSAEZb9/BPQIS940ZQcIxSDEfOK01hndSeAP4ozSrs84Hy34vzI8xj+X3SJYXXkVtZW7DL00Cq1qzl+22hjnjUXoWxXPfqFjIqTrvwcjDZTN504q0+rXaUPQjM42MXdl0HM66DOjOZOrVlRGT5ZcPOJuv3yPgxDOIL324I2DA/wQqjgiW13oeu+OSy0yhKzUXhehTNRfAOWdHLbOtUAYUot0XODiaAjD9lvWbcFCc3vBEFC/nyGujyEfmYnnJcZbvFLOzUuBIAZ8RGpE4Tj5JNdxUuHILEAn9ayf1sg3XsDDmhCp1cJWrv3f18vcfUB8vW5NLhWOij8Nyp9JHX8JzefsMh/RtDKiuf++XBqbtH5zDgcFihiLwmliXC7Jk69NDZSlbUSxpnrHPzlL4hmvdv8fRyEYOuBfa6xnIkyst2VB4JVG3vYpBRPqjAv42/A9tfjsckZT4IoeWZx92zO2x71AsG/iUWuixV8UYIoNaej2VIwPxreTrsZDCGyNNJ07uISYtu35EgM6VXzweb31tXFCUm7FAUBNt99VWKs44ee3mcGJnXMj3XJsCWzJGmQizt91NdprmkytgSO7PbdJCwJyItlQ8rPj79CBGnAQdBzU6FGcaxkOVaHL78W1NNmU3AkslU5/AmM0ZgZsSTzVaWsIT4MzKvnbuM3Wsd5wyL7tuYVf8qdilzl7pX9IZC9LQlK/1oSN7RJLCFA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3495.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66476007)(76116006)(66556008)(66446008)(55016003)(66946007)(83380400001)(5660300002)(8936002)(33656002)(86362001)(186003)(26005)(52536014)(2906002)(53546011)(7696005)(9686003)(6506007)(54906003)(71200400001)(508600001)(38070700005)(122000001)(110136005)(38100700002)(316002)(8676002)(64756008)(4326008)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?f5TPR198KzDhlLN9Z3wBAxyiSiim2eFGl9cE2A9g8cY83PJNC81kUWSrQ3S/?= =?us-ascii?Q?j/1DfaUgEZctxEu4NfndVHOdo3r3Z3SiKK+dKLZzaYKYS48u8g3Q8/O8WcvE?= =?us-ascii?Q?CV1crSdK//oZD05nNto0KvP+qnpMg3L0PpMXza2cUbTdAdwLzVBjBOwLaNuK?= =?us-ascii?Q?pVTf95lD4iL/WTJmrKaCOVbs9oIx1w0t+ddspQ70wqFDgTpON7FZdCWXtnnK?= =?us-ascii?Q?7yKrvWxZfA9VbNu/2Qcp/pNittaStu2QWaf/fsy2i7FysRWXXC/2JL5MSRca?= =?us-ascii?Q?w4isM6/OBDFquMuS3py+jLG3JPKijoU8hXHZl78gyg4KdjmCcweo7pduY4mE?= =?us-ascii?Q?rp0WTFWAMrUz91mKJQqb9IXRBLBJyQrLPRX4giuIgvaxhyvwJwWcdzw+79Hn?= =?us-ascii?Q?q+yGV95ybWjs/cbv5y3IfvOaTKyf6P3dhKtSWF/0F6qFjVvhd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yckWK+iaiBh9N2HXenv755aZfZDnBCVQpc8Cs?= =?us-ascii?Q?0Cc0JxQ0ATsO7/y8OB6L3j6dRItfOpEbMpemNInrpOd8C4mk20r17Y9Oktnj?= =?us-ascii?Q?XX4UD14uBnFx1cydrx4qHl60F2rhEXwbkSCNDxpKZhKV7dKJYbwAFZvrEtjv?= =?us-ascii?Q?I9Slldy5yyk9yL6D/59KXg8RkIHaMV2tFtXk7JhNDN6dePmpXB8YohN8JKJb?= =?us-ascii?Q?wGiXW/bgK36/f0I1jQxY6GNEAm/eaG5IHcGVeyU8GKYeKImh2YkorrkFLiGO?= =?us-ascii?Q?kBErTT2XDdTS7UXZqoxBt+C18njHT5PW8f+nUfv74kfaYjSjygsgg99xK1Dy?= =?us-ascii?Q?0vbBo/8E40vvT6LTb3z5rR1u6uMLEkVg1LqJsPk3OgMd3XTyeo8SDlbIp+kz?= =?us-ascii?Q?rehDeMOP3Q=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3495.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 648a2472-d49e-4ece-9949-08da2d0602ab X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2022 13:08:26.3888 (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: uRpPBOO79PcMBWwpmOQeRc18C6QhyzETa8QbVFL3C15Z/mV+4v/NZcsJ8a9V894nI2dUi216W2i7XrwpQQ/XCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3568 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: Don Wallwork > Sent: Monday, May 2, 2022 22:11 > To: dev@dpdk.org > Cc: donw@xsightlabs.com; stephen@networkplumber.org; mb@smartsharesystems= .com; Burakov, Anatoly > ; dmitry.kozliuk@gmail.com; Richardson, Bruce = ; > Honnappa.Nagarahalli@arm.com; nd@arm.com > Subject: [PATCH] eal: allow worker lcore stacks to be allocated from huge= page memory >=20 > Add support for using hugepages for worker lcore stack memory. The > intent is to improve performance by reducing stack memory related TLB > misses and also by using memory local to the NUMA node of each lcore. >=20 > EAL option '--huge-worker-stack [stack-size-kbytes]' is added to allow > the feature to be enabled at runtime. If the size is not specified, > the system pthread stack size will be used. >=20 > Signed-off-by: Don Wallwork > --- > lib/eal/common/eal_common_options.c | 31 ++++++++++++++ > lib/eal/common/eal_internal_cfg.h | 4 ++ > lib/eal/common/eal_options.h | 2 + > lib/eal/linux/eal.c | 65 ++++++++++++++++++++++++++++- > 4 files changed, 100 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_com= mon_options.c > index f247a42455..be9db9ee37 100644 > --- a/lib/eal/common/eal_common_options.c > +++ b/lib/eal/common/eal_common_options.c > @@ -103,6 +103,7 @@ eal_long_options[] =3D { > {OPT_TELEMETRY, 0, NULL, OPT_TELEMETRY_NUM }, > {OPT_NO_TELEMETRY, 0, NULL, OPT_NO_TELEMETRY_NUM }, > {OPT_FORCE_MAX_SIMD_BITWIDTH, 1, NULL, OPT_FORCE_MAX_SIMD_BITWIDTH_NUM}= , > + {OPT_HUGE_WORKER_STACK, 2, NULL, OPT_HUGE_WORKER_STACK_NUM }, >=20 > {0, 0, NULL, 0 } > }; > @@ -1618,6 +1619,22 @@ eal_parse_huge_unlink(const char *arg, struct huge= page_file_discipline *out) > return -1; > } >=20 > +static int > +eal_parse_huge_worker_stack(const char *arg, size_t *huge_worker_stack_s= ize) > +{ > + size_t worker_stack_size; > + if (arg =3D=3D NULL) { > + *huge_worker_stack_size =3D USE_OS_STACK_SIZE; > + return 0; > + } > + worker_stack_size =3D atoi(arg); > + if (worker_stack_size =3D=3D 0) > + return -1; Should we also to check "worker_stack_size *1024 < PTHREAD_STACK_MIN" ? > + > + *huge_worker_stack_size =3D worker_stack_size * 1024; > + return 0; > +} > + > -- > 2.17.1