Please see https://gerrit.fd.io/r/c/vpp/+/38507 

 

-----Original Message-----

From: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>  <vpp-dev@lists.fd.io 
<mailto:vpp-dev@lists.fd.io> > On Behalf Of Hao Tian

Sent: Wednesday, March 15, 2023 10:14 PM

To: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io> 

Subject: Re: [vpp-dev] Race condition between bihash deletion and searching - 
misuse or bug?

 

Hi Dave,

 

Thanks for your work. I am ready to test whenever needed.

 

Best regards,

Hao Tian

 

________________________________________

From: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>  <vpp-dev@lists.fd.io 
<mailto:vpp-dev@lists.fd.io> > on behalf of Dave Barach <v...@barachs.net 
<mailto:v...@barachs.net> >

Sent: Thursday, March 16, 2023 7:02 AM

To: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io> 

Subject: Re: [vpp-dev] Race condition between bihash deletion and searching - 
misuse or bug?

 

I'm doing a bit of work to straighten out the template, hopefully without 
causing a measurable performance regression.

 

Hao's test code is a bit of a corner-case: there is exactly one record in the 
database which the code thrashes as hard as possible.

 

D.

 

-----Original Message-----

From: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>  <vpp-dev@lists.fd.io 
<mailto:vpp-dev@lists.fd.io> > On Behalf Of Andrew Yourtchenko

Sent: Wednesday, March 15, 2023 12:33 PM

To: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io> 

Subject: Re: [vpp-dev] Race condition between bihash deletion and searching - 
misuse or bug?

 

Hao,

 

I noticed the same behavior when stress-testing the multi thread session 
handling for the ACL plugin a while ago. I thought this trade off is there to 
avoid having to do the hard locks in bihash code, rather than it being a bug.

 

As you say - the special value comes only if the deletion is in progress, and 
it is always the same. So I just treated that case in my code same as “not 
found”.

 

My logic was: if an entry is just in process of being deleted, there is very 
little use for its old value anyway.

 

--a

 

> On 15 Mar 2023, at 14:45, Hao Tian <tianhao...@outlook.com 
> <mailto:tianhao...@outlook.com> > wrote:

> 

> Hi,

> 

> I tried but could not come up with any way that is able to ensure the kvp 
> being valid upon return without using the full bucket lock.

> 

> Maybe we can make a copy of the value before returning, validate the copy and 
> return that copy instead. Critical section can be shrinked to cover only the 
> copying process, which seems to perform better, but I'm not sure if this is 
> the best approach.

> 

> Could you please shed some light here? Thanks!

> 

> Regards,

> Hao Tian

> 

 

 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22714): https://lists.fd.io/g/vpp-dev/message/22714
Mute This Topic: https://lists.fd.io/mt/97599770/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to