Skip to content

Commit e5fa2e2

Browse files
committed
fix bug cal lines_per_thread
1 parent 9d6e5fe commit e5fa2e2

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

storage/innobase/buf/buf0flu.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4383,12 +4383,13 @@ DECLARE_THREAD(pm_log_redoer_worker)(
43834383
mutex_exit(&redoer->mutex);
43844384

43854385
//thread_id = os_thread_pf(os_thread_get_curr_id());
4386-
lines_per_thread = redoer->size / (srv_ppl_n_redoer_threads - 1);
4386+
//lines_per_thread = redoer->size / (srv_ppl_n_redoer_threads - 1);
4387+
lines_per_thread = (redoer->size - 1) / srv_ppl_n_redoer_threads + 1;
43874388

43884389
//thread_id = syscall(SYS_gettid);
43894390
//idx = thread_id % srv_ppl_n_redoer_threads;
43904391

4391-
printf("Redoers thread %zu idx %zu created\n",thread_id, idx);
4392+
printf("Redoers thread %zu lines_per_thread %zu created \n",idx, lines_per_thread);
43924393

43934394
while (true) {
43944395
//worker thread wait until there is is_requested signal

storage/innobase/log/log0recv.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4473,7 +4473,7 @@ pm_ppl_analysis(
44734473
//plog_block->state = PMEM_FREE_BLOCK;
44744474
continue;
44754475
}
4476-
//add block->key the per-line hashtable
4476+
/*add block->key into the per-line hashtable */
44774477
pm_ppl_hash_add(pop, ppl, pline, plog_block, j);
44784478

44794479
if(low_watermark >

storage/innobase/pmem/pmem0log.cc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ pm_ppl_reset_all(
235235

236236
//(1) Reset the log blocks
237237
pm_page_part_log_bucket_reset(pop, ppl);
238-
__reset_tt(pop, ppl);
238+
239+
/*we don't use TT in this implementation*/
240+
//__reset_tt(pop, ppl);
239241
}
240242

241243
/**/
@@ -444,7 +446,9 @@ PMEM_PAGE_PART_LOG* alloc_pmem_page_part_log(
444446

445447
ppl->pmem_alloc_size += ppl->pmem_page_log_free_pool_size;
446448

447-
//(4) transaction table
449+
/* (4) transaction table */
450+
/* We don't use TT in this implementation*/
451+
/*
448452
__init_tt(
449453
pop,
450454
ppl,
@@ -453,7 +457,7 @@ PMEM_PAGE_PART_LOG* alloc_pmem_page_part_log(
453457
PMEM_TT_MAX_DIRTY_PAGES_PER_TX);
454458
455459
ppl->pmem_alloc_size += ppl->pmem_tt_size;
456-
460+
*/
457461
pmemobj_persist(pop, ppl, sizeof(*ppl));
458462
return ppl;
459463
}
@@ -1835,6 +1839,7 @@ pm_ppl_write_rec(
18351839
plogbuf->cur_off += rec_size;
18361840

18371841
if (!pline->is_req_checkpoint){
1842+
/*comment this line to disable checkpoint (for debugging)*/
18381843
pm_ppl_check_for_ckpt(pop, ppl, pline, plogbuf, rec_lsn);
18391844
}
18401845
/*early realease the general lock*/
@@ -3943,8 +3948,8 @@ pm_ppl_flush_page(
39433948
//plog_block->firstLSN may a little greater than bpage->oldest_modification, we don't assert here
39443949
//assert(plog_block->firstLSN == bpage->oldest_modification);
39453950

3951+
//pmemobj_rwlock_wrlock(pop, &pline->lock);
39463952
pmemobj_rwlock_wrlock(pop, &pline->meta_lock);
3947-
39483953
pmemobj_rwlock_wrlock(pop, &plog_block->lock);
39493954

39503955
/*save the write_off before reseting*/
@@ -3999,10 +4004,10 @@ pm_ppl_flush_page(
39994004
pline->oldest_block_off = min_off;
40004005

40014006
}
4002-
4007+
//pmemobj_rwlock_wrlock(pop, &pline->meta_lock);
40034008
HASH_DELETE(plog_hash_t, addr_hash, pline->addr_hash, key, item);
4004-
40054009
pmemobj_rwlock_unlock(pop, &pline->meta_lock);
4010+
//pmemobj_rwlock_unlock(pop, &pline->lock);
40064011

40074012
//printf("pm_ppl_flush space %zu page %zu pageLSN %zu pline %zu oldest_block_off %zu\n",
40084013
// space, page_no, pageLSN, pline->hashed_id, pline->oldest_block_off);

0 commit comments

Comments
 (0)