From mboxrd@z Thu Jan 1 00:00:00 1970 From: Honnappa Nagarahalli Subject: Re: [PATCH 3/4] hash: fix rw concurrency while moving keys Date: Wed, 3 Oct 2018 17:39:13 +0000 Message-ID: References: <1536253938-192391-1-git-send-email-honnappa.nagarahalli@arm.com> <1536253938-192391-4-git-send-email-honnappa.nagarahalli@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Gavin Hu (Arm Technology China)" , Steve Capper , Ola Liljedahl , nd , "Gobriel, Sameh" To: "Wang, Yipeng1" , "Richardson, Bruce" , "De Lara Guarch, Pablo" Return-path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30050.outbound.protection.outlook.com [40.107.3.50]) by dpdk.org (Postfix) with ESMTP id 020AA5F25 for ; Wed, 3 Oct 2018 19:39:15 +0200 (CEST) In-Reply-To: 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" > >-----Original Message----- > >[Wang, Yipeng] I was thinking about another corner case and wondering > >if the version counter needs to be done on key deletion as well. > >For example, a reader reads out the index and falsely matches a > >signature, before it reads out the data and the key, the key-data pair > >got deleted, removed, and recycled by another writer thread. This > >writer partially overwrote the key (because key store is too large to be > atomic). > >Now, the reader begins to compare the key, and accidentally matches the > >key (because the key is partially written and accidentally matches), > >will The reader read the wrong data out (which should have been a lookup > miss)? > > > [Wang, Yipeng] As a second thought after reading your slides, I think the > scenario I described above should be handled by the upper level applicati= on > using RCU-like mechanisms to recycle key-data only after the grace period= . > So I think it is OK. Please ignore my last comment. >=20 > But if convenient, please add more comment in the API doc and in user > guide as well just in case users might not understand the restriction. >=20 Agree, it needs careful documentation. I plan to change the documentation a= fter the patch is completed. > Thanks > Yipeng