[ovs-dev] Difference between hmap and cmap

Ben Pfaff blp at ovn.org
Mon Sep 19 15:16:30 UTC 2016


On Mon, Sep 19, 2016 at 01:53:37AM -0400, Hui Kang wrote:
> I am studying the hashing functions in OVS and find these two
> implementations: hmap and cmap. I understand that cmap is the improved
> cuckoo hashing and cmap supports multiple-reader and single writer. My
> questions are:
> 
> 1. What does hmap stand for? hash map?

Yes.

> 2. hmap looks much simpler than cmap; does it support multi-reader and
> single writers?

hmap supports multiple readers OR a single writer at a given time.
cmap supports multiple readers AND a single writer at a given time.

> 3. If cmap performs better than hmap, why not using cmap all over the OVS
> code?

I don't think it does perform better than hmap, except in a case where
there's lots of parallelism.



More information about the dev mailing list