From patchwork Wed May 30 04:32:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 40509 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96C471B0B; Wed, 30 May 2018 06:32:11 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0044.outbound.protection.outlook.com [104.47.0.44]) by dpdk.org (Postfix) with ESMTP id C743A14EC for ; Wed, 30 May 2018 06:32:10 +0200 (CEST) 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=P2aL478d/wRL5IShFH1GlsIqtt5PicRyu0VeS6udGPU=; b=j2hhbykkz0On4YaCoV7hx2fFJqCTKaI4UKdIsUhIkhGMgHThPO0qYpUUwtVhjoGZe6W2PxVjd6WlRgBr1GPxAN9ZiZZRJ/jAi3krcjxKIDMrF7d7qybelYKdivc8NVsT2epRnysBqLcnuhY6ImOeXPmCskbO7AlPJk2eJrL+c8c= Received: from HE1PR0801MB1930.eurprd08.prod.outlook.com (10.168.94.136) by HE1PR0801MB1914.eurprd08.prod.outlook.com (10.168.94.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Wed, 30 May 2018 04:32:09 +0000 Received: from HE1PR0801MB1930.eurprd08.prod.outlook.com ([fe80::fda2:4190:c78c:7a01]) by HE1PR0801MB1930.eurprd08.prod.outlook.com ([fe80::fda2:4190:c78c:7a01%13]) with mapi id 15.20.0797.017; Wed, 30 May 2018 04:32:09 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger CC: Olivier Matz , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] rte_ring: clarify preemptable nature of ring algorithm Thread-Index: AQHT979rbDAJa4DNL0+8FYgB8VeQ96RHrYtg Date: Wed, 30 May 2018 04:32:09 +0000 Message-ID: References: <1527570373-120745-1-git-send-email-honnappa.nagarahalli@arm.com> In-Reply-To: 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=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0801MB1914; 7:m9xppPacs1lTFejw3sh00iVRFdnYq3YkSGaKjJyIyn1AhIQdnGUpjZkzN3tDNEg+TdqaabtP+x5ixGWsPpJK2NxAVFK47EXLwW3SPhVtj/ZcaGYSzsjYXI4FADX8gdHmhNtdmcgDTyGqKNzqyhGZPxNdTkjXeTWJkyZYR1tesj/vabSVgvLXwcz4uD99UZWXI3U6JL3jJkyEi31fj08WZzGEBrwtAhO4ES7SRbaHmbMRibtmAS60kdt3uQeLQ3NC x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB1914; x-ms-traffictypediagnostic: HE1PR0801MB1914: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(21748063052155); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB1914; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1914; x-forefront-prvs: 0688BF9B46 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39380400002)(366004)(39860400002)(376002)(189003)(199004)(40434004)(97736004)(6306002)(72206003)(81166006)(66066001)(3660700001)(54896002)(86362001)(2900100001)(55016002)(6436002)(6506007)(53546011)(186003)(81156014)(229853002)(68736007)(76176011)(236005)(5250100002)(9686003)(316002)(54906003)(5890100001)(102836004)(7696005)(26005)(59450400001)(5660300001)(6246003)(11346002)(446003)(25786009)(99286004)(4326008)(33656002)(14454004)(476003)(53936002)(6916009)(7736002)(74316002)(8936002)(8676002)(106356001)(105586002)(6116002)(3280700002)(3846002)(2906002)(790700001)(478600001)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0801MB1914; H:HE1PR0801MB1930.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-microsoft-antispam-message-info: VeyhyfXn8rmIL9dilqKZPeKYIHrA3immJy5hZF6maZzowIxTZW2Fc81ySrdr1FXK8bWWBiP2QHfy3lfBvIPyagy/12ZlPHnwYmZwF2lzOrCrwGcES1DqBW20fnA9jjiwHpsZektcN3HkovbcvqGMtfqKY7Fx70qkpzBuF4C3jxXQagp4v4eiHI9ODWqBZ5g3 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ae23448a-e6f2-41a4-bcd2-08d5c5e64e7f X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae23448a-e6f2-41a4-bcd2-08d5c5e64e7f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2018 04:32:09.1843 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1914 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] rte_ring: clarify preemptable nature of ring algorithm 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" Agree Stephen. But rte_ring is not as basic as spinlock. IMO, existing note results in more questions than answers. From: Stephen Hemminger Sent: Tuesday, May 29, 2018 9:39 PM To: Honnappa Nagarahalli Cc: Olivier Matz ; dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] rte_ring: clarify preemptable nature of ring algorithm Spinlock has same problem On Tue, May 29, 2018, 1:06 AM Honnappa Nagarahalli > wrote: rte_ring implementation is not preemptable only under certain circumstances. This clarification is helpful for data plane and control plane communication using rte_ring. Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Gavin Hu > Reviewed-by: Ola Liljedahl > --- lib/librte_ring/rte_ring.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please 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. diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index d3d3f7f..2f9c945 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -26,8 +26,13 @@ * - Bulk dequeue. * - Bulk enqueue. * - * Note: the ring implementation is not preemptable. A lcore must not - * be interrupted by another task that uses the same ring. + * Note: the ring implementation can block threads from completing their + * operation under the following circumstances. + * A preempted thread can block other threads (operating on the same ring) + * from completing their operations, only if those threads are performing + * the same ring operation (enqueue/dequeue) as the preempted thread. + * In other words, a preempted consumer thread will not block any producer + * threads and vice versa. * */