Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Merging PMDebugger into Pmemcheck #83

Open
wants to merge 11 commits into
base: pmem-3.15
Choose a base branch
from
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.vscode/
*.o

.DS_Store
# /
/.in_place
/.vs
Expand Down
44 changes: 44 additions & 0 deletions PMDebuggerToPmemcheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
In general, I try to add some new features on top of Pmemcheck instead of giving a new debugging tool like PMDebugger.

In this file, I briefly show what has changed and why for each commit. For more details, you can read our paper: Fast, Flexible, and Comprehensive Bug Detection for Persistent Memory Programs.

### just add new structure -- d0df66235227777c7b1c0d9b035f2c2ac2f35773

- Add memory location information array which includes **arr_md** structure and **pmem_stores_array** structure.

- Information of most stores is deleted in a short term, so we use the array to keep track of hot and short-lived information and avoid the overhead of tree reorganizations (reorganizations in Oset structure).
- Most stores can be collectively flushed, so we use arr_md structure to collectively maintain and update persistency status for high performance.



### modify the algorithm of trace_pmem_store() -- f0f262471645a79ea50a8074ab36927b12185904

- Add memory location information into the memory location information array.
- A new function for the array structure to split stores (array_split_stores ()).
- A new function for the array structure to handle multiple stores (array_handle_with_mult_stores()).

- A new function for the array structure to handle multiple overwrite warns (array_add_mult_overwrite_warn()).
- A new function for the array structure to update minimum and maximum address in arr_md structure (update_array_metadata_minandmax()).

- A new function for the array structure to compare a region with minimum and maximum address in arr_md structure (cmp_with_arr_minandmax()).



### modify the algorithm of do_flush -- 1ec603086958d841b35e46ffef02d9c66116a698

- Leverage arr_md structure to collectively maintain and update persistency status for high performance when processing writeback instructions (array_process_flush()).



### modify the algorithm of do_fence -- 263d2af8510304ccc7613c8660e903522ce8ef6e

- Leverage arr_md structure to process fence instruction and the way is similar to processing writeback instructions (array_process_fence()).
- Directly invalidates arr_md structure to achieve quickly deletion after processing fence instruction.



### fix bugs and pass the simple verification (perl tests/vg_regtest pmemcheck -- 58e2ccbad20bdfe9d88d80b4adc704cc43517928

- Add codes in print_store_stats() to print not persistent stores in the array
- Add codes in case VG_USERREQ__PMC_SET_CLEAN to remove regions from memory location information array

19 changes: 18 additions & 1 deletion pmemcheck/pmc_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@

#ifndef PMC_INCLUDE_H
#define PMC_INCLUDE_H
/*
* Metadata structure for store information array.
* Start index and end index point to elements in pmem_stores.
* The metadata stores information (min_addr, max_addr and flushed_state) for
* elements between start index and end index */
struct arr_md {

UWord start_index;
UWord end_index;
Addr min_addr;
Addr max_addr;
enum flushed_state {
NO_FLUSHED,
PART_FLUSHED,
ALL_FLUSHED,
} state;
};


/** Single store to memory. */
struct pmem_st {
Expand All @@ -33,7 +51,6 @@ struct pmem_st {
/*------------------------------------------------------------*/
/*--- Common functions ---*/
/*------------------------------------------------------------*/

/* Check if the given region is in the set. */
UWord is_in_mapping_set(const struct pmem_st *region, OSet *region_set);

Expand Down
Loading