> librdmacm already has a cleanup function which releases all resources it
> holds. Missing from that cleanup are entries with struct index_map,
> which are dynamically allocated, whereas the map itself is declared
> static. Because librdmacm plays otherwise nicely with valgrind this
> patch aims to free the memory held by index map entries, mainly to
> reduce valgrind noise.
> This patch adds the function idm_free() to free all entries of an index
> map. A call to this function is added in the ucma_cleanup destructor.
> The ucma_idm struct index_map is cleaned using idm_free().
> There is another struct index_map in preload.c and rsocket.c, but there
> are no destructors yet and I don't feel competent enough to add them.

Instead of adding idm_free, I added count values to the index_map structure.  
The allocated arrays are freed whenever the count drops to 0.  This should 
handle all three cases -- cma, preload, and rsocket.

I sent out a separate patch to address this.  Please let me know if you see any 
issues with it.

- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to