Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge PMDK to Master #7

Closed
wants to merge 37 commits into from
Closed

Merge PMDK to Master #7

wants to merge 37 commits into from

Conversation

pyrito
Copy link
Collaborator

@pyrito pyrito commented Mar 29, 2020

Reason for this PR

Wanted to integrate PMDK changes to the master branch to ensure recoverability of data structures allocated in persistent memory. Currently still working on P-CLHT. Transactions are included but are yet to be verified. See issue #5

How to enable PM?

  1. Install PMDK
$ cd pmdk
$ git checkout tags/1.6
$ make -j
$ cd ..  
  1. Emulate PM with Ext4-DAX mount
$ sudo mount -o dax /dev/pmem0 /mnt/pmem
  1. Set pool_size and pool name in clht_lb_res.c. TODO: instructions to set up environment variables instead.

  2. Make accordingly and run the example.

Checklist

  • Changes are clean and readable; make logical sense
  • Changes are correct, passes tests
  • API changes are reflected in README
  • Any required documentation is changed explicitly

@pyrito pyrito requested a review from SeKwonLee March 29, 2020 17:31
Copy link
Member

@vijay03 vijay03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change README.md to explain how to use the pmdk branch please?

Could we also add a new pmdk.md to explain the porting effort at a high level?

Copy link
Member

@SeKwonLee SeKwonLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Need changes to properly use PMDK transactions or to employ non-transactional APIs instead only to resolve memory leak problems. There are two separate APIs provided by libpmemobj: non-transactional API and transactional. If you employ transactional API across the entire range of updates, we don't need to employ RECIPE conversions at all such as manually adding flushes after each atomic store. PMDK transaction would transparently handle everything to ensure the crash-consistent updates of data structures by using undo logging. Instead of employing transactional API, we may be able to use mini-transactional features provided in non-transactional APIs to handle memory leak problems. (Please check following these links: link1, link2, link3).

  2. Another issue we need to address is the default PMDK pointer size (16 bytes). Different from traditional dynamic 8-byte pointers, libpmemobj uses 16-byte pointers consisting of uuid and offset, which indicate the universal identifier (8 bytes) of memory-mapped files and the offset (8 bytes) from the starting virtual address of the memory-mapped file respectively. If we simply replace 8-byte pointers with 16-byte PMDK pointers, we can lose the benefits of the cache-efficient layout of original RECIPE indexes. For example, in our current modification, we simply replace the "next" pointer in bucket_t structure with PMEMoid (16bytes) type variable. After this modification, the bucket size is changed from 64 bytes (cache line size) to 72 bytes, so this will lead bucket allocations unaligned by cache lines. uuid is used to distinguish different memory pools and should be employed for the specific applications allocating objects from multiple memory pools. However, as RECIPE indexes only need to use a single memory pool, we can initialize uuid globally at program startup and can store offsets only as pointers in the objects of data structures.

@vijay03
Copy link
Member

vijay03 commented Mar 31, 2020

Hi @pyrito, I think I had a different pull request in mind, just talking about the existence of the PMDK branch in README + explaining how to setup and use PMDK with Recipe. The actual details of the implementation can stay within this branch, so regardless of the implementation, master's README.md should have a pointer to this branch.

@pyrito
Copy link
Collaborator Author

pyrito commented Mar 31, 2020

Hi @vijay03 ,

Was your intention to have another branch with README modifications instead?

@vijay03
Copy link
Member

vijay03 commented Mar 31, 2020

no, directly in master. So you would have to submit a different pull request.

pyrito and others added 11 commits March 31, 2020 21:16
Edited the main README to refer to the PMDK branch in the "limitations" section. Created a PMDK README for P-CLHT.
1. Merge recent masstree modifications from master
1. Add system requirements: the huge performance drop in PMDK was
observed in old kernel versions (v4.X). After changing the kernel to
latest version (v5.3), it becomes performing well.
2. Change the instructions of installing pmdk to use latest-stable
branch.
@pyrito
Copy link
Collaborator Author

pyrito commented Apr 18, 2020

No need to merge the code. Branches are made to be separate.

@pyrito pyrito closed this Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants