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

Dead Page Reference Count Bug Fix #181

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8fd6fb0
save debug changes
Oct 21, 2024
f94af8d
ref count changes
Dec 18, 2024
b990c00
Merge branch 'main' of https://github.com/mathworks/llfs
Dec 18, 2024
e9a43b7
Merge branch 'main' into ref_count_bug_fix
Dec 18, 2024
f6d4360
removed death-test
Dec 18, 2024
315d8ba
added a histogram plot for the bug hits
Dec 18, 2024
8f92645
temp fix for the test failure
Jan 7, 2025
4b68e88
page_tracer test case fix
Jan 8, 2025
34e1b71
fixed llfs crash-recovery test case
Jan 15, 2025
550ca3c
updated the test page_count
Jan 16, 2025
cdf7ea7
updated test cases
Jan 16, 2025
1f2d280
added support for recycler calling recycle_pages with depth>0
Jan 21, 2025
6216416
minor style changes...
Jan 21, 2025
0c5f7d8
Merge branch 'main' of https://github.com/mathworks/llfs
Jan 21, 2025
908043c
Merge branch 'main' into ref_count_bug_fix
Jan 21, 2025
20cf66a
submodule update
Jan 22, 2025
18020d7
added support for partial dead page processing
Jan 31, 2025
f9a97fc
removed attachment-index display code
Jan 31, 2025
ad2980a
fixed depth related check
Jan 31, 2025
985bd25
updated page_index logic
Jan 31, 2025
2785b7f
updated variable name
Feb 1, 2025
35c646d
update to avoid clearing the entire log
Feb 1, 2025
5d350d1
changed some test paramaters
Feb 3, 2025
be0412d
:review comment changes
Feb 3, 2025
3548923
update some comments and log messages
Feb 3, 2025
e560bc6
updated some log messages
Feb 3, 2025
f8815b1
simplified check function
Feb 3, 2025
dae089d
made recycle_pages more modular
Feb 4, 2025
56187de
removed a typo
Feb 4, 2025
6d70676
updated variable name
Feb 4, 2025
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 script
Submodule script updated 1 files
+1 −1 conan-targets.mk
16 changes: 11 additions & 5 deletions src/llfs/committable_page_cache_job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ Status CommittablePageCacheJob::commit_impl(const JobCommitParams& params, u64 c
const PageCacheJob* job = this->job_.get();
BATT_CHECK_NOT_NULLPTR(job);

LLFS_VLOG(1) << "commit(PageCacheJob): entered";
if (durable_caller_slot) {
LLFS_VLOG(1) << "commit(PageCacheJob): entered" << BATT_INSPECT(prev_caller_slot)
<< BATT_INSPECT(*durable_caller_slot);
} else {
LLFS_VLOG(1) << "commit(PageCacheJob): entered" << BATT_INSPECT(prev_caller_slot);
}

// Make sure the job is pruned!
//
Expand Down Expand Up @@ -426,7 +431,7 @@ auto CommittablePageCacheJob::start_ref_count_updates(const JobCommitParams& par
PageRefCountUpdates& updates, u64 /*callers*/)
-> StatusOr<DeadPages>
{
LLFS_VLOG(1) << "commit(PageCacheJob): updating ref counts";
LLFS_VLOG(1) << "commit(PageCacheJob): updating ref counts" << BATT_INSPECT(params.caller_slot);

DeadPages dead_pages;

Expand Down Expand Up @@ -579,10 +584,11 @@ Status CommittablePageCacheJob::recycle_dead_pages(const JobCommitParams& params

BATT_ASSIGN_OK_RESULT(
slot_offset_type recycler_sync_point,
params.recycler.recycle_pages(as_slice(dead_pages.ids), params.recycle_grant,
params.recycle_depth + 1));
params.recycler.recycle_pages(as_slice(dead_pages.ids), params.caller_slot,
params.recycle_grant, params.recycle_depth + 1));

LLFS_VLOG(1) << "commit(PageCacheJob): waiting for PageRecycler sync point";
LLFS_VLOG(1) << "commit(PageCacheJob): waiting for PageRecycler sync point"
<< BATT_INSPECT(params.caller_slot);

return params.recycler.await_flush(recycler_sync_point);
//
Expand Down
5 changes: 3 additions & 2 deletions src/llfs/page_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,9 @@ bool PageAllocator::await_ref_count(PageId page_id, i32 ref_count)
if ((counter & 4095) == 0) {
LLFS_LOG_INFO() << BATT_INSPECT(prc) << BATT_INSPECT(page_id) << BATT_INSPECT(ref_count)
<< BATT_INSPECT(counter);
BATT_CHECK_LT(counter, 10 * 1000) << "[PageAllocator::await_ref_count] timed out (10s)"
<< BATT_INSPECT(page_id) << BATT_INSPECT(ref_count);
BATT_CHECK_LT(counter, 10 * 1000)
<< "[PageAllocator::await_ref_count] timed out (10s)" << BATT_INSPECT(page_id)
<< BATT_INSPECT(ref_count) << BATT_INSPECT(prc.ref_count);
}
}
return true;
Expand Down
3 changes: 3 additions & 0 deletions src/llfs/page_allocator_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,14 @@ PageAllocatorState::ProposalStatus PageAllocatorState::propose(PackedPageAllocat
// If this is a valid proposal that will cause state change, go through and change the deltas to
// the new ref count values.
//
LLFS_VLOG(1) << "propose (start): txn-ref-count= " << txn->ref_counts.size();
if (status == ProposalStatus::kValid) {
for (PackedPageRefCount& prc : txn->ref_counts) {
LLFS_VLOG(1) << "reference count: " << prc;
prc.ref_count = this->calculate_new_ref_count(prc);
}
}
LLFS_VLOG(1) << "propose (end): txn-ref-count= " << txn->ref_counts.size();

return status;
}
Expand Down
Loading