@@ -32,16 +32,18 @@ static uint64_t PMEM_N_FLUSH_THREADS;
32
32
// set this to large number to eliminate
33
33
// static uint64_t PMEM_PAGE_PER_BUCKET_BITS=32;
34
34
35
+ // 1 < this_value < flusher->size (32)
36
+ // static uint64_t PMEM_FLUSHER_WAKE_THRESHOLD=5;
37
+ static uint64_t PMEM_FLUSHER_WAKE_THRESHOLD=30 ;
38
+
39
+ static FILE* debug_file = fopen(" part_debug.txt" ," a" );
40
+
35
41
#if defined (UNIV_PMEMOBJ_BUF_PARTITION)
36
42
// 256 buckets => 8 bits, max 32 spaces => 5 bits => need 3 = 8 - 5 bits
37
43
static uint64_t PMEM_N_BUCKET_BITS = 8 ;
38
44
static uint64_t PMEM_N_SPACE_BITS = 5 ;
39
45
static uint64_t PMEM_PAGE_PER_BUCKET_BITS=10 ;
40
- // 1 < this_value < flusher->size
41
- // static uint64_t PMEM_FLUSHER_WAKE_THRESHOLD=5;
42
- static uint64_t PMEM_FLUSHER_WAKE_THRESHOLD=2 ;
43
46
44
- static FILE* debug_file = fopen(" part_debug.txt" ," w" );
45
47
46
48
/*
47
49
* This is the "clear" version of hash function, use it for debugging
@@ -111,6 +113,7 @@ pm_wrapper_buf_alloc_or_open(
111
113
PMEM_BUF_FLUSH_PCT = srv_pmem_buf_flush_pct;
112
114
#if defined (UNIV_PMEMOBJ_BUF_FLUSHER)
113
115
PMEM_N_FLUSH_THREADS= srv_pmem_n_flush_threads;
116
+ PMEM_FLUSHER_WAKE_THRESHOLD = srv_pmem_flush_threshold;
114
117
#endif
115
118
116
119
#if defined (UNIV_PMEMOBJ_BUF_PARTITION)
@@ -200,7 +203,7 @@ pm_wrapper_buf_alloc_or_open(
200
203
pmw->pbuf ->cur_free_param = 0 ; // start with the 0
201
204
202
205
// Open file
203
- pmw->pbuf ->deb_file = fopen (" pmem_debug.txt" ," w " );
206
+ pmw->pbuf ->deb_file = fopen (" pmem_debug.txt" ," a " );
204
207
205
208
// ////test for recovery
206
209
// printf("========== > Test for recovery\n");
@@ -2310,7 +2313,7 @@ pm_buf_resume_flushing(
2310
2313
2311
2314
for (i = 0 ; i < PMEM_N_BUCKETS; i++) {
2312
2315
#if defined (UNIV_PMEMOBJ_BUF_RECOVERY_DEBUG)
2313
- printf (" \n ====>resuming flush hash %zu\n " , i);
2316
+ // printf ("\n====>resuming flush hash %zu\n", i);
2314
2317
#endif
2315
2318
TOID_ASSIGN (cur_list, (D_RW (buf->buckets )[i]).oid );
2316
2319
phashlist = D_RW (cur_list);
@@ -2471,7 +2474,12 @@ pm_buf_assign_flusher(
2471
2474
// delay calling flush up to a threshold
2472
2475
// printf("trigger worker...\n");
2473
2476
// if (flusher->n_requested == flusher->size - 2) {
2474
- if (flusher->n_requested == PMEM_FLUSHER_WAKE_THRESHOLD) {
2477
+ // if (flusher->n_requested == PMEM_FLUSHER_WAKE_THRESHOLD) {
2478
+ if (flusher->n_requested >= PMEM_FLUSHER_WAKE_THRESHOLD) {
2479
+ #if defined (UNIV_PMEMOBJ_BUF_RECOVERY_DEBUG)
2480
+ printf (" \n in [1.1] try to trigger flusher list_id = %zu\n " , phashlist->list_id );
2481
+ #endif
2482
+
2475
2483
os_event_set (flusher->is_req_not_empty );
2476
2484
}
2477
2485
@@ -2560,6 +2568,9 @@ void pm_buf_bucket_stat_init(PMEM_BUF* pbuf) {
2560
2568
pbuf->bucket_stats = arr;
2561
2569
}
2562
2570
2571
+ /*
2572
+ *Print statistic infomation for all hashed lists
2573
+ * */
2563
2574
void pm_buf_stat_print_all (PMEM_BUF* pbuf) {
2564
2575
ulint i;
2565
2576
PMEM_BUCKET_STAT* arr = pbuf->bucket_stats ;
@@ -2592,6 +2603,10 @@ void pm_buf_stat_print_all(PMEM_BUF* pbuf) {
2592
2603
sumstat.n_writes , sumstat.n_overwrites , sumstat.n_reads , sumstat.n_reads_hit , sumstat.n_reads_flushing , sumstat.max_linked_lists , sumstat.n_flushed_lists );
2593
2604
fprintf (pbuf->deb_file , " \n ==========\n " );
2594
2605
2606
+ fprintf (debug_file, " \n ==========\n Statistic info:\n n_writes n_overwrites n_reads n_reads_hit n_reads_flushing max_linked_lists n_flushed_lists \n %zu %zu %zu %zu %zu %zu %zu \n " ,
2607
+ sumstat.n_writes , sumstat.n_overwrites , sumstat.n_reads , sumstat.n_reads_hit , sumstat.n_reads_flushing , sumstat.max_linked_lists , sumstat.n_flushed_lists );
2608
+ fprintf (pbuf->deb_file , " \n ==========\n " );
2609
+
2595
2610
}
2596
2611
2597
2612
#endif // UNIV_PMEMOBJ_STAT
0 commit comments