[dpdk-dev] [PATCH] lib/librte_hash: add rte_hash_del_key_fixed without compact

Wang, Yipeng1 yipeng1.wang at intel.com
Thu May 14 19:44:29 CEST 2020


> -----Original Message-----
> From: Lilijun (Jerry) <jerry.lilijun at huawei.com>
> Sent: Tuesday, May 12, 2020 6:28 PM
> To: Wang, Yipeng1 <yipeng1.wang at intel.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>; 'dev at dpdk.org' <dev at dpdk.org>
> Cc: wangyunjian <wangyunjian at huawei.com>; xudingke
> <xudingke at huawei.com>; 'stable at dpdk.org' <stable at dpdk.org>; nd
> <nd at arm.com>; nd <nd at arm.com>
> Subject: 答复: [dpdk-dev] [PATCH] lib/librte_hash: add
> rte_hash_del_key_fixed without compact

<...>

> > [Yipeng]
> > Could you tell me more on the use case? Since insertion would also
> > invalidate the Iterator, do you insert keys only to new table during resizing?
> >
> [Lilijun (Jerry)]
> Yes, Insert only to new table. Because the resize process need take a write
> lock and the old table's key insertion are prevented by the lock now.
> Do you mean the key insertion may change other key's position by cuckoo
> hash algorithm and invalidate the iterator?
> That maybe a new question I haven't met yet.

[Wang, Yipeng] 
For cuckoo algorithm, if the table is relatively full, new inserted key could move other keys around in the table.
For example, when I insert A, A could move B to B's alternative bucket to make
space for A, that’s where the name "cuckoo" comes from. 😊
So if you insert keys into table, the iterators should be invalidated too. But as you said you only insert keys
to new table while you iterate only the old table right?


More information about the dev mailing list