From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wang, Yipeng1" Subject: Re: [PATCH v5 5/8] hash: add read and write concurrency support Date: Fri, 13 Jul 2018 01:55:20 +0000 Message-ID: References: <1528455078-328182-1-git-send-email-yipeng1.wang@intel.com> <20180711134907.01d8eaf0@xeon-e3> <4478633.7AMRLkzmKO@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "De Lara Guarch, Pablo" , "Richardson, Bruce" , "honnappa.nagarahalli@arm.com" , "vguvva@caviumnetworks.com" , "brijesh.s.singh@gmail.com" , "Wang, Ren" , "Gobriel, Sameh" , "Tai, Charlie" To: Thomas Monjalon , Stephen Hemminger , "myravjev@amicon.ru" Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 99EBF1B173 for ; Fri, 13 Jul 2018 03:55:23 +0200 (CEST) In-Reply-To: <4478633.7AMRLkzmKO@xps> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thanks for pointing me to this patch. I guess the try-locks still does not solve the overhead of multiple readers= contending the counter. It just provides a non-blocking version of the sa= me algorithm. The relock function looks interesting. But it would be helpful if any speci= al use case or example is given. Specifically, who should call this functio= n, the reader or the writer? Leonid, could you provide more context? The TLRW example I gave is potentially a better rw-lock algorithm. Paper Re= ference: D. Dice and N Shavit. "TLRW: return of the read-write lock". In s= uch scheme, readers won't contend the same reader counter which introduces = heavy cache bouncing that Stephen mentioned. Maybe we should introduce sim= ilar algorithm into rte_rwlock library. >-----Original Message----- >From: Thomas Monjalon [mailto:thomas@monjalon.net] >Sent: Thursday, July 12, 2018 1:30 PM >To: Wang, Yipeng1 ; Stephen Hemminger >Cc: dev@dpdk.org; De Lara Guarch, Pablo ; = Richardson, Bruce ; >honnappa.nagarahalli@arm.com; vguvva@caviumnetworks.com; brijesh.s.singh@g= mail.com; Wang, Ren ; >Gobriel, Sameh ; Tai, Charlie >Subject: Re: [dpdk-dev] [PATCH v5 5/8] hash: add read and write concurrenc= y support > >12/07/2018 03:22, Wang, Yipeng1: >> From: Stephen Hemminger [mailto:stephen@networkplumber.org] >> >> > For small windows, reader-writer locks are slower than a spin lock >> > because there are more cache bounces. >> >> Hi, Stephen, >> >> You are correct and we understand that spinlock might be slightly faster= than counter based rwlock in this case. However, the >counter based rwlock is the exception path when TSX fails. >> >> If performance of this exception path is a big concern, a more optimal r= ead-write lock scheme (e.g. TLRW) should be introduced into >rte_rwlock in the future. > >Something like this? > eal/rwlocks: Try read/write and relock write to read locks added > https://patches.dpdk.org/patch/40254/ > >