zhemao / rmem-server

Remote memory pool over infiniband RDMA
5 stars 1 forks source link

Rvm better malloc #4

Closed NathanTP closed 9 years ago

NathanTP commented 9 years ago

better malloc changes what was rvm_alloc to rvm_blk_alloc() which allocates only at a block granularity (but now supports multi-page allocations). Users can now supply a custom malloc/free implementation based on rvm_blk_alloc to get more sophisticated memory allocation. As an example, this branch introduces the malloc_simple allocator (which just calls rvm_blk_alloc directly) and buddy_alloc. The buddy allocator uses the buddy algorithm for requests < 1page (basically it dynamically subdivides a pool of memory in powers of 2 until it gets blocks with the desired size. Sort of like multigrid.). For larger allocations it calls rvm_blk_alloc directly.

All the changes to how the block table is managed have made the semantics of rvmrec() a bit nonsensical. Since pointers now work, I've introduced a new method called rvm[set/get]_usr_data(). Users now register a pointer to some recoverable data structure that they use when recovering. rvm_rec is still in rvm.c but it's use should be phased out.