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 A6FB8430BF; Mon, 21 Aug 2023 12:19:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D3C042BC9; Mon, 21 Aug 2023 12:19:14 +0200 (CEST) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 5550B427E9 for ; Mon, 21 Aug 2023 12:19:13 +0200 (CEST) Received: from frapeml100008.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RTpNB5y9Hz67mY4; Mon, 21 Aug 2023 18:18:34 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml100008.china.huawei.com (7.182.85.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 21 Aug 2023 12:19:11 +0200 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.031; Mon, 21 Aug 2023 12:19:11 +0200 From: Konstantin Ananyev To: Honnappa Nagarahalli , =?iso-8859-1?Q?Morten_Br=F8rup?= , "dev@dpdk.org" CC: "konstantin.v.ananyev@yandex.ru" , Wathsala Wathawana Vithanage , nd , nd Subject: RE: Ring library optimization idea Thread-Topic: Ring library optimization idea Thread-Index: AdnTSADDofJIeE2PSx6EnyX+/hQSngAiil6QABF4yrA= Date: Mon, 21 Aug 2023 10:19:11 +0000 Message-ID: <9bb4e5524ca94cc59f652db50ae4d1ee@huawei.com> References: <98CBD80474FA8B44BF855DF32C47DC35D87B21@smartserver.smartshare.dk> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.195.247.142] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected 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 Hi Morten, > > Most of the fast path ring library functions access the two cache lines= containing > > respectively the r->prod and r->cons structures. > > > > Some of the fast path functions also have to fetch r->capacity and r->m= ask, > > which reside in another cache line. > > > > What do you think about adding shadow variables of r->capacity and r->m= ask > > to the same cache line as r->prod, to improve ring library performance = (by > > avoiding having to read a third cache line) when under CPU cache pressu= re? > Agree with the idea. I am not sure about the performance as these are rea= d-only data. IMO, we should not worry about it as it saves > one cache line (but we do not need to measure the performance). They will= occupy 12B, but I do not see how we will occupy the > entire 64B of the cacheline in the near future. >=20 > Also, the shadow variables need to be part of both r->prod and r->cons. Personally, I think that for majority of cases the perf gain with be either= tiny or none. >From other side, I don't see any harm with that approach, as Honnapa said, = we do should have space for that in prod/cons cache-lines. So, no objections from me in general. Thanks Konstantin =20