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

PM allocator and post-crash GC #14

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion P-CLHT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ set(P_CLHT_TEST example.cpp src/clht_lb_res.c src/clht_gc.c
add_executable(example ${P_CLHT_TEST})

target_link_libraries(example ${TbbLib} ${JemallocLib} boost_system
boost_thread pthread)
boost_thread pthread pmemobj pmem)
4 changes: 2 additions & 2 deletions P-CLHT/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using namespace std;

#include "clht.h"
#include "clht_lb_res.h"
#include "ssmem.h"

typedef struct thread_data {
Expand Down Expand Up @@ -117,7 +117,7 @@ void run(char **argv) {
barrier_cross(&barrier);

for (uint64_t i = start_key; i < end_key; i++) {
uintptr_t val = clht_get(tds[thread_id].ht->ht, keys[i]);
uintptr_t val = clht_get(tds[thread_id].ht, keys[i]);
if (val != keys[i]) {
std::cout << "[CLHT] wrong key read: " << val << "expected: " << keys[i] << std::endl;
exit(1);
Expand Down
5 changes: 4 additions & 1 deletion P-CLHT/external/ssmem/src/ssmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include <assert.h>
#include <string.h>

#include <libpmemobj.h>

ssmem_ts_t* ssmem_ts_list = NULL;
volatile uint32_t ssmem_ts_list_len = 0;
__thread volatile ssmem_ts_t* ssmem_ts_local = NULL;
Expand Down Expand Up @@ -542,7 +544,8 @@ ssmem_mem_reclaim(ssmem_allocator_t* a)
do
{
rel_cur = rel_nxt;
free(rel_cur->mem);
PMEMoid cur_mem_oid = pmemobj_oid((void *)rel_cur->mem);
pmemobj_free(&cur_mem_oid);
free(rel_cur);
rel_nxt = rel_nxt->next;
}
Expand Down
Loading