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

Add compile option WITH_PMEM and runtime config enable_pmem #329

Merged
merged 3 commits into from Sep 15, 2022

Conversation

iyupeng
Copy link
Contributor

@iyupeng iyupeng commented Sep 6, 2022

What problem does this PR solve?

Problem Summary: Introducing optional volatile KV storage on DRAM

What is changed and how it works?

What's Changed:

  • add compile option WITH_PMEM, which is ON by default
  • add enable_pmem in KVDK::Configs, which is true by default
  • cmake with -DWITH_PMEM=OFF to remove dependency to libpmem
  • even built with -DWITH_PMEM=ON, setting Configs.enable_pmem = false can make KVDK store data on DRAM

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • None

Signed-off-by: Yu, Peng <peng.yu@intel.com>
@iyupeng
Copy link
Contributor Author

iyupeng commented Sep 6, 2022

There will be another pull request to rename variables and update license headers.

@iyupeng
Copy link
Contributor Author

iyupeng commented Sep 6, 2022

The original pull request to be split: #327

uint64_t max_offset_;

bool thread_local_counter_enabled_{};
std::vector<std::int64_t> thread_allocated_sizes_;
Copy link
Contributor

Choose a reason for hiding this comment

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

False sharing, potential bottleneck.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to use std::int64_t* in next commit.

@@ -143,16 +143,20 @@ bool DLList::Replace(DLRecord* old_record, DLRecord* new_record,
old_record->PersistPrevNT(new_record_offset);
} else {
new_record->prev = prev_offset;
#ifdef KVDK_WITH_PMEM
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should redefine pmem_persist()/pmem_memcpy()/pmem_memmove() as macros for compiling without pmem so that we can reduce macros?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion. I find 7 locations where checking KVDK_WITH_PMEM could be removed with this improvement.

Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
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.

None yet

3 participants