[dpdk-dev] [PATCH 3/4] hash: fix rw concurrency while moving keys

Wang, Yipeng1 yipeng1.wang at intel.com
Wed Oct 3 02:16:02 CEST 2018


>-----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 application using RCU-like mechanisms to recycle key-data only after the grace period. So I think it is OK. Please ignore my last comment.

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.

Thanks
Yipeng



More information about the dev mailing list