[ewg] [PATCH v2] libibverbs: ibv_fork_init() and libhugetlbfs

Roland Dreier rdreier at cisco.com
Sat Jul 3 13:19:07 PDT 2010


 >  When registering two memory regions A and B from within
 > the same huge page, we will end up with one node in the tree which covers the
 > whole huge page after registering A. When the second MR is registered, a node
 > is created with the MR size rounded to the system page size (as there is no
 > need to call madvise(), it is not noticed that MR B is part of a huge page).
 > 
 > Now if MR A is deregistered before MR B, I see that the tree containing
 > mem_nodes is empty afterwards, which causes problems for the deregistration of
 > MR B, leaving the tree in a corrupted state with negative refcounts. This also
 > breaks later registrations of other memory regions within this huge page.

Good thing I didn't get around to applying the patch yet ;)

I haven't thought this through fully, but it seems that maybe we could
extend the madvise tracking tree to keep track of the page size used for
each node in the tree.  Then for the registration of MR B above, we
would find the node for MR A covered MR B and we should be able to get
the ref counting right.

 - R.
-- 
Roland Dreier <rolandd at cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html



More information about the ewg mailing list