From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30041.outbound.protection.outlook.com [40.107.3.41]) by dpdk.org (Postfix) with ESMTP id 69FA02BD3 for ; Fri, 29 Mar 2019 09:53:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/YqiuzoW5fWqRMa/CWnQeQ2rTSu2Y/Wb2dj+57XxypI=; b=jBvSfI3caF4of73AQbOPb6nBZO/xu7Tqvmh0GSqvkRbbSB8H0V2E47D+MYZnYsErAe2fG7w7trKcpH+u/hX8RycbEx0PlWDMmBupmi7+JfWi0OBKeYcHMdj5frwVlMU1i72ISmZNlQq4U2ignxeK4PChb3MtQgGWZ1Ygfvv/u78= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB2640.eurprd08.prod.outlook.com (10.175.245.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Fri, 29 Mar 2019 08:53:35 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::707a:b455:dcb2:9d40]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::707a:b455:dcb2:9d40%2]) with mapi id 15.20.1750.017; Fri, 29 Mar 2019 08:53:35 +0000 From: "Gavin Hu (Arm Technology China)" To: Darek Stojaczyk , "dev@dpdk.org" CC: "james.r.harris@intel.com" , "changpeng.liu@intel.com" , "anatoly.burakov@intel.com" , "thomas@monjalon.net" , Honnappa Nagarahalli Thread-Topic: [dpdk-dev] [PATCH] fbarray: fix attach deadlock Thread-Index: AQHU5e24UyVQAbpRqUSvDUh4Uv0LUKYiTUMg Date: Fri, 29 Mar 2019 08:53:35 +0000 Message-ID: References: <20190329050951.153202-1-dariusz.stojaczyk@intel.com> In-Reply-To: <20190329050951.153202-1-dariusz.stojaczyk@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 915f4219-52aa-4426-b526-08d6b4240776 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB2640; x-ms-traffictypediagnostic: VI1PR08MB2640: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0991CAB7B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39860400002)(136003)(40434004)(189003)(199004)(13464003)(26005)(3846002)(4326008)(8936002)(478600001)(105586002)(81156014)(71190400001)(8676002)(71200400001)(6436002)(81166006)(54906003)(52536014)(68736007)(316002)(106356001)(55016002)(9686003)(256004)(6246003)(5024004)(14444005)(2501003)(72206003)(7696005)(53546011)(76176011)(55236004)(186003)(110136005)(5660300002)(53936002)(86362001)(99286004)(66066001)(14454004)(33656002)(2906002)(6506007)(476003)(486006)(446003)(6116002)(229853002)(11346002)(305945005)(7736002)(102836004)(74316002)(25786009)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB2640; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: gX52hjMN4J2XSwmNPA9TNVkzZ1VobWNsoGc69y64Rg9kfgFYunMWnGVerx4DKkQPiGaFFpsGSBQLFkkNDqEOCAiT4/P/EBbeX5z6W14yrzw77DcNRLHcIMKBX2Xfxd5EsRxacJ2i5H8hwiQTfzfPoFRXCBaAt63/hHmnLb0rQ2+IwpMafyP6DxLL2kVQ83p7s9ZD/xLUWS8BCQCB9YwjRfHZUKtyJxIof80FSNk/r24LDACSCN8tU7s+s8MP+6WbL3fc+y+gOrGxhztLtOaxr7jtQQ+KbuxX0rmwZDgTDRXr5GWOrCLV3S6P1LTzF5VkCv4eUHGUJ9PnQS57BkiweUrguxUb9zxjapwdX0Z6OR9gNyHFNs3//tz13oKYHSZ2XrjI+M6OuOGvH9ga1mbI8dRYpDtLQmfaeSghqCXtBH8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 915f4219-52aa-4426-b526-08d6b4240776 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2019 08:53:35.5345 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2640 Subject: Re: [dpdk-dev] [PATCH] fbarray: fix attach deadlock 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: , X-List-Received-Date: Fri, 29 Mar 2019 08:53:37 -0000 > -----Original Message----- > From: dev On Behalf Of Darek Stojaczyk > Sent: Friday, March 29, 2019 1:10 PM > To: dev@dpdk.org > Cc: james.r.harris@intel.com; changpeng.liu@intel.com; Darek Stojaczyk > ; anatoly.burakov@intel.com; > thomas@monjalon.net > Subject: [dpdk-dev] [PATCH] fbarray: fix attach deadlock > > rte_fbarray_attach() currently locks its internal > spinlock, but never releases it. Secondary processes > won't even start if there is more than one fbarray > to be attached to - the second rte_fbarray_attach() > would be just stuck. > > Fix it by releasing the lock at the end of > rte_fbarray_attach(). I believe this was the original > intention. > > Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas") > Cc: anatoly.burakov@intel.com > Cc: thomas@monjalon.net > > Signed-off-by: Darek Stojaczyk > --- > lib/librte_eal/common/eal_common_fbarray.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/librte_eal/common/eal_common_fbarray.c > b/lib/librte_eal/common/eal_common_fbarray.c > index 0e7366e5e..5ca8d6f0e 100644 > --- a/lib/librte_eal/common/eal_common_fbarray.c > +++ b/lib/librte_eal/common/eal_common_fbarray.c > @@ -906,6 +906,7 @@ rte_fbarray_attach(struct rte_fbarray *arr) > > /* we're done */ > > +rte_spinlock_unlock(&mem_area_lock); > return 0; > fail: > if (data) > @@ -913,6 +914,7 @@ rte_fbarray_attach(struct rte_fbarray *arr) > if (fd >=3D 0) > close(fd); > free(ma); > +rte_spinlock_unlock(&mem_area_lock); > return -1; > } This is an obvious issue, good catch! Reviewed-by: Gavin Hu > -- > 2.17.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3B6D0A05D3 for ; Fri, 29 Mar 2019 09:53:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A317F2BF4; Fri, 29 Mar 2019 09:53:38 +0100 (CET) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30041.outbound.protection.outlook.com [40.107.3.41]) by dpdk.org (Postfix) with ESMTP id 69FA02BD3 for ; Fri, 29 Mar 2019 09:53:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/YqiuzoW5fWqRMa/CWnQeQ2rTSu2Y/Wb2dj+57XxypI=; b=jBvSfI3caF4of73AQbOPb6nBZO/xu7Tqvmh0GSqvkRbbSB8H0V2E47D+MYZnYsErAe2fG7w7trKcpH+u/hX8RycbEx0PlWDMmBupmi7+JfWi0OBKeYcHMdj5frwVlMU1i72ISmZNlQq4U2ignxeK4PChb3MtQgGWZ1Ygfvv/u78= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB2640.eurprd08.prod.outlook.com (10.175.245.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Fri, 29 Mar 2019 08:53:35 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::707a:b455:dcb2:9d40]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::707a:b455:dcb2:9d40%2]) with mapi id 15.20.1750.017; Fri, 29 Mar 2019 08:53:35 +0000 From: "Gavin Hu (Arm Technology China)" To: Darek Stojaczyk , "dev@dpdk.org" CC: "james.r.harris@intel.com" , "changpeng.liu@intel.com" , "anatoly.burakov@intel.com" , "thomas@monjalon.net" , Honnappa Nagarahalli Thread-Topic: [dpdk-dev] [PATCH] fbarray: fix attach deadlock Thread-Index: AQHU5e24UyVQAbpRqUSvDUh4Uv0LUKYiTUMg Date: Fri, 29 Mar 2019 08:53:35 +0000 Message-ID: References: <20190329050951.153202-1-dariusz.stojaczyk@intel.com> In-Reply-To: <20190329050951.153202-1-dariusz.stojaczyk@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 915f4219-52aa-4426-b526-08d6b4240776 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB2640; x-ms-traffictypediagnostic: VI1PR08MB2640: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0991CAB7B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39860400002)(136003)(40434004)(189003)(199004)(13464003)(26005)(3846002)(4326008)(8936002)(478600001)(105586002)(81156014)(71190400001)(8676002)(71200400001)(6436002)(81166006)(54906003)(52536014)(68736007)(316002)(106356001)(55016002)(9686003)(256004)(6246003)(5024004)(14444005)(2501003)(72206003)(7696005)(53546011)(76176011)(55236004)(186003)(110136005)(5660300002)(53936002)(86362001)(99286004)(66066001)(14454004)(33656002)(2906002)(6506007)(476003)(486006)(446003)(6116002)(229853002)(11346002)(305945005)(7736002)(102836004)(74316002)(25786009)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB2640; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: gX52hjMN4J2XSwmNPA9TNVkzZ1VobWNsoGc69y64Rg9kfgFYunMWnGVerx4DKkQPiGaFFpsGSBQLFkkNDqEOCAiT4/P/EBbeX5z6W14yrzw77DcNRLHcIMKBX2Xfxd5EsRxacJ2i5H8hwiQTfzfPoFRXCBaAt63/hHmnLb0rQ2+IwpMafyP6DxLL2kVQ83p7s9ZD/xLUWS8BCQCB9YwjRfHZUKtyJxIof80FSNk/r24LDACSCN8tU7s+s8MP+6WbL3fc+y+gOrGxhztLtOaxr7jtQQ+KbuxX0rmwZDgTDRXr5GWOrCLV3S6P1LTzF5VkCv4eUHGUJ9PnQS57BkiweUrguxUb9zxjapwdX0Z6OR9gNyHFNs3//tz13oKYHSZ2XrjI+M6OuOGvH9ga1mbI8dRYpDtLQmfaeSghqCXtBH8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 915f4219-52aa-4426-b526-08d6b4240776 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2019 08:53:35.5345 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2640 Subject: Re: [dpdk-dev] [PATCH] fbarray: fix attach deadlock 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" Message-ID: <20190329085335.-2HHJY7fpAUILSPHdQUFi4tLFmhPAlZYSMHzVIoCO-8@z> > -----Original Message----- > From: dev On Behalf Of Darek Stojaczyk > Sent: Friday, March 29, 2019 1:10 PM > To: dev@dpdk.org > Cc: james.r.harris@intel.com; changpeng.liu@intel.com; Darek Stojaczyk > ; anatoly.burakov@intel.com; > thomas@monjalon.net > Subject: [dpdk-dev] [PATCH] fbarray: fix attach deadlock > > rte_fbarray_attach() currently locks its internal > spinlock, but never releases it. Secondary processes > won't even start if there is more than one fbarray > to be attached to - the second rte_fbarray_attach() > would be just stuck. > > Fix it by releasing the lock at the end of > rte_fbarray_attach(). I believe this was the original > intention. > > Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas") > Cc: anatoly.burakov@intel.com > Cc: thomas@monjalon.net > > Signed-off-by: Darek Stojaczyk > --- > lib/librte_eal/common/eal_common_fbarray.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/librte_eal/common/eal_common_fbarray.c > b/lib/librte_eal/common/eal_common_fbarray.c > index 0e7366e5e..5ca8d6f0e 100644 > --- a/lib/librte_eal/common/eal_common_fbarray.c > +++ b/lib/librte_eal/common/eal_common_fbarray.c > @@ -906,6 +906,7 @@ rte_fbarray_attach(struct rte_fbarray *arr) > > /* we're done */ > > +rte_spinlock_unlock(&mem_area_lock); > return 0; > fail: > if (data) > @@ -913,6 +914,7 @@ rte_fbarray_attach(struct rte_fbarray *arr) > if (fd >=3D 0) > close(fd); > free(ma); > +rte_spinlock_unlock(&mem_area_lock); > return -1; > } This is an obvious issue, good catch! Reviewed-by: Gavin Hu > -- > 2.17.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.