From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89E6AA00BE; Mon, 27 Apr 2020 18:51:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5BE2B1D528; Mon, 27 Apr 2020 18:51:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 7DB9F1D519 for ; Mon, 27 Apr 2020 18:51:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03RGkQOd012724; Mon, 27 Apr 2020 09:51:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=mlBFUH5UvZ38KjLMagdh+KuPT104qaVJEJM+bAlVsO4=; b=K4peVrUFJ9K1zy683ZknfeoDYiR0VunY7GhrWVN8pA6wi2G7QoWCqh8x6zAxXHiCpDv2 PBL971cXSloY3Z/IXMTyADE35kU/MumYvpc9L81pJGE4DJbaQcF4q9H5PMXkVzIf8J7a bFeugIjKBXeEmgc/4wdT6RwEq6CxKBrZSvxC79g77q7/hPCblFEmc3IjlmA9fA8D39Gh wCgdRj4Om3oFgpvdbMXQN32afZ0cIkQzJJh3fKVTb3EN8+SRwnrMC+lU1DB/VPU8bU81 B9ApOHOLoFwy67HGpKRsUdqReV/9hoYi9ns31YsKmuGMVrIa/J3rpT+irwVx8ZY6c359 2w== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 30mjjq8du8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 27 Apr 2020 09:51:45 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Apr 2020 09:51:43 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 27 Apr 2020 09:51:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J8P5hj48n27xpWFzIwXe1D2fJhrylZN/yHPPdjnvWUAGkx8mxkjM55C9lLKVGlBIA9NFP/j8kESIlry54hRLZskPOo96/OJ++wivBAqx/RkEYE+H7BiApxkFDf5P0PwoLb8iLNrXuNDvDRDXEPLQfi5VNYctBz+22u/1fU274rMDrbOut+c6g0I/uL5WA2f2SlP+WDsW5IjW3zqDprM2K2LHiQp4syju6uLBg067dBMtt0dDG8+ErnZ6Qj+qT0/pgWiUffbvhDflKTetdS4ypihTVPIweTSPMhnhZ6ZvsAQdzz+qk01aEPosJH2+PKd60b/GWo+e0VbjXKrrIuBXrA== 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-SenderADCheck; bh=mlBFUH5UvZ38KjLMagdh+KuPT104qaVJEJM+bAlVsO4=; b=Momu7MQSZmcTuedpl3Q2ws2PcQ7UeyfaUgBWQqrO+hiB4HeompeZWkK00SeyUlAY02AvmKF4lkZPqPwUSG60UQ+QaC+s19EZPquxB9hzxzwokY9yL6foFUPiMwmDZ1wf4MB+2gA7oqIhoCljjuC5TCe30itGy8rcZkG3ghcW1w09rnKCvQwPBdLppieT3DMT2mTHgI2a4vn4dgrjnfyUxOX9ZgDelo4NIYARwAW2dIHUVUi8qKs4eDn+tGe3M021IfG30s5R6Acp7zNQ3Oin3Zz58MK6fsTIfSLfeF+REJ3ol1sVsiFEKdXxduieDYPi+VW8QJqF/i3Ch4xv1LcyiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mlBFUH5UvZ38KjLMagdh+KuPT104qaVJEJM+bAlVsO4=; b=Jv/HZm+iOT4025nnXhwSjPVsQcUhamCY6HLuPdAM0GeNjUVg5z0Xx0OEGsHCJ1ZHRPxTfKQciDK6Nx77UjuV1VWTvc92zCBh7HKUkKTCImbKIqYhYnvuJ8I4Os84YL9LI6vDAkoPtAgCfGu45WFLop7Dl/OWl/UhrCDjvUBmKq0= Received: from BYAPR18MB2518.namprd18.prod.outlook.com (2603:10b6:a03:13b::18) by BYAPR18MB3061.namprd18.prod.outlook.com (2603:10b6:a03:10e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 16:51:42 +0000 Received: from BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289]) by BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289%3]) with mapi id 15.20.2937.023; Mon, 27 Apr 2020 16:51:42 +0000 From: Pavan Nikhilesh Bhagavatula To: Christos Ricudis , Anatoly Burakov , Konstantin Ananyev , Jerin Jacob Kollanukkaran CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal: Place EAL thread stack in a reserved per-lcore memzone Thread-Index: AQHWEXNHnq3CflmGd0ixAYpnWfCLlaiNRFcg Date: Mon, 27 Apr 2020 16:51:42 +0000 Message-ID: References: <1586768952-10554-1-git-send-email-ricudis@niometrics.com> In-Reply-To: <1586768952-10554-1-git-send-email-ricudis@niometrics.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [223.226.86.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8f7ed348-4745-4a21-7d9a-08d7eacb432f x-ms-traffictypediagnostic: BYAPR18MB3061: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1148; x-forefront-prvs: 0386B406AA x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2518.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(376002)(39860400002)(396003)(366004)(346002)(64756008)(66946007)(66556008)(71200400001)(86362001)(6636002)(5660300002)(9686003)(4326008)(52536014)(55016002)(66476007)(2906002)(478600001)(8936002)(316002)(186003)(66446008)(76116006)(33656002)(6506007)(7696005)(81156014)(55236004)(110136005)(26005); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: exaL6thXHm1nGMqHHWW5Rc+gpeBLKLeFokQR3BXtOaSKcOmuQacAYKHxSprF709y2j4bklJIPVOmLMzQV609uZNhI73iftUr+Tf53AkEhUFlTzQ0stYH0tIVJiYlK0Xntyur5waq/7iciVFcI7kRfXubyuiKZiQRfLvBeMayA1xRSmIl7OWKjCiBfr6esJiDxTkisMw8OvOv7c2/KTqxzpQPMtL/TFFwwDQ7bcC0opmDwYrC5oesput3CnBPSP+Ra3LxeyVG+ZSr5KxNxJ+reiUD9oI8nL70xvFT4X87mxn0W6e2PtE3Tv3RB9RVYjM3TnWng0vl+2LgXHh3THXgeKK3CCiDqjXv141mAxvmA17p4w7lq9M1r184Cfon6/cVZFs2KS+H2IfOJIIBKaFi/jM/mso4i6kp6DXpPsy1qL8rn2rVoHkJwSFJZft8MRrY x-ms-exchange-antispam-messagedata: sZCoQu/8YzCaY8uTZJ0iqYIcRnb5QpDDU6RXyxPnMpNIpXcCtDU31mNCvkVeuTYO6aMxNlA0q8VSu1205DTILtRQXV9UFiHpqRINzQ+bSV6xeGPpCW7kRCTXJT1/H8Nglnr+Fsr76JhCiY3D/UBvxWBbTV+gi2pHSH8foOhBy9IIAivSsmtSVAhDJcqtDeSZ/3+gSq1MgRDevbYW5iAc7XZCg+vkDsgVR38gObChIPzfYbaiKISG7YOskE6JemHhX5c49WaDX3MZaqY+5IAeIUzHzHIqErBzicWe36IhytVSJohabEJkjS0j6JX0TPSMmlbBBZL240IaUxzwuhC1Bai+04i5KkVqFtg4S8qQKp5U3yNzAXWotwXcTFJlXHGStvnsGUmr/WCWMmehtd7+bNwNijTCquX9aAFsV/5Z588EhW1CaUAepNKxN8PJ3klbcpFqUr41jcj9RwIjj3UFpXDmTwJCosENVahoEZB5oJX7Br0CUnRhCyjIu+6YQgOBv6ZhoidFOujFBZaJpKu1mpuxbpXfPllhKIZ6gJQk4yZm5LQDJF7yl98pDc15K9LOPC2FeGH8+FWhBOytOlURHBfQa/1JyvjKD/S3+UsOpnKeef4DEsrzR7IlTAnj2gZ9QcqKf0yGqJ8h+GSrKvbm0WHacGcIdQmdlZlodGZdlN/GBoaKXyOpl5a16F9qbsc5+xXWrPI0mD8tGENN/snAjQDu6lha123qPxl4S56z766dIEasGez4zZjF0uKap6Y/RtY2o3Z7WZidb6me7ESvhV3yF1IF/+nag5Fnjkhq708= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8f7ed348-4745-4a21-7d9a-08d7eacb432f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2020 16:51:42.2091 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tF3gc/rxW6GTfBhr+MpL43NIWAH/VwWYZuS2TqdXAcB5+or4/83gMAF9zBwdOrOUXKYMlUNLMe7KE0DHtuBlBoPi+J2zs7oStA9S59Ev8eE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB3061 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-27_12:2020-04-27, 2020-04-27 signatures=0 Subject: Re: [dpdk-dev] [PATCH] eal: Place EAL thread stack in a reserved per-lcore memzone X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > lib/librte_eal/linux/eal.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c >index 9530ee5..e047107 100644 >--- a/lib/librte_eal/linux/eal.c >+++ b/lib/librte_eal/linux/eal.c >@@ -68,6 +68,8 @@ > > #define KERNEL_IOMMU_GROUPS_PATH >"/sys/kernel/iommu_groups" > >+#define THREAD_STACK_SIZE_DEFAULT (4ULL * 1024ULL * 1024ULL) >+#include > /* Allow the application to print its usage message too if set */ > static rte_usage_hook_t rte_application_usage_hook =3D NULL; > >@@ -1224,6 +1226,24 @@ static void rte_eal_init_alert(const char >*msg) > > lcore_config[i].state =3D WAIT; > >+ pthread_attr_t attr; >+ pthread_attr_init(&attr); >+ size_t thread_stack_size =3D >THREAD_STACK_SIZE_DEFAULT; >+ char thread_stack_name[64]; >+ snprintf(thread_stack_name, sizeof >thread_stack_name, "rte:lcore:%s:%d:threadstack", >rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY ? "p" : "s", i); >+ const struct rte_memzone *mz =3D >rte_memzone_lookup(thread_stack_name); >+ if (mz =3D=3D NULL) { >+ if ((mz =3D >rte_memzone_reserve(thread_stack_name, thread_stack_size, >lcore_config[i].socket_id, 0)) =3D=3D NULL) { >+ rte_panic("Cannot allocate memzone >for thread stack"); >+ } >+ } >+ void *thread_stack =3D mz->addr; >+ >+ if (pthread_attr_setstack(&attr, thread_stack, >thread_stack_size) < 0) { >+ rte_panic("Cannot set thread stack\n"); >+ } >+ RTE_LOG(DEBUG, EAL, "Thread stack for lcore %d on >socket %d set to %p\n", i, lcore_config[i].socket_id, thread_stack); >+ > /* create a thread for each lcore */ > ret =3D pthread_create(&lcore_config[i].thread_id, NULL, > eal_thread_loop, NULL); Don't we need to pass attr struct created above to ptherad_create as 2nd ar= gument?. Also, since there is no way to modify master_lcore stack space most of DPDK= testsuite wouldn't show any difference. Pavan. >-- >1.8.3.1