Skip to content

perf(ext4): prevent lmbench ext4_create_delete_files_0k_ops timeout by indexing the orphan chain - #2392

Draft
mistcoversmyeyes wants to merge 2 commits into
DragonOS-Community:masterfrom
mistcoversmyeyes:perf/ext4-orphan-chain-scan-timeout-issue2327-pr2392
Draft

mistcoversmyeyes wants to merge 2 commits into
DragonOS-Community:masterfrom
mistcoversmyeyes:perf/ext4-orphan-chain-scan-timeout-issue2327-pr2392

Conversation

@mistcoversmyeyes

Copy link
Copy Markdown
Collaborator

Replaces #2346.

Fixes #2327. Related: #2286.

A large final-unlink backlog repeatedly validates the entire ext4 legacy orphan chain and walks it again to find a reclaim predecessor. This makes create/delete batches increasingly expensive. The default lat_fs size sweep exceeded its original 120-second deadline; a stopped-state sample during deletion found validate_chain called by legacy_orphan_contains / unlink_inode.

Keep a membership/predecessor index for the validated logical chain. Initial use and any aborted index update still validate the complete chain, while normal add/remove transitions update the index under the existing metadata mutation gate. Removal rereads the target and predecessor and verifies allocation, checksums, inode generation and links. Transaction drop/abort invalidates provisional changes; successful logical publication retains them, and an older batch checkpoint cannot revive an invalidated index. Replay invalidates the index. No on-disk format or journal credit budget changes.

  • Baseline original wrapper exceeded 120 seconds. In a fresh fixed guest with ENOUGH, TIMING_O and LOOP_O explicitly unset, the original ext4_create_delete_files_0k_ops.sh completed all default 0/1/4/10 KiB stages with exit status 0 within the same deadline. No size selection, calibration parameter or deadline was changed; this is a completion check, not a controlled throughput comparison.
  • make kernel, rustfmt and git diff --check passed.
  • 206 another_ext4 unit tests passed, including index transitions, abort/drop, successful direct/journal/batch publication, and journal failure boundaries.
  • Real-image namespace_transactions (including both persistence models), batched_delalloc, and batched_fragmented_reclaim regressions passed with their filesystem consistency checks.
  • Reclaim, linked-tail final unlink and linked-tail rename recovery fault matrices passed for writeback and writethrough persistence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(ext4): ext4_create_delete_files_0k_ops test_case times out with a performance bottleneck in repeated orphan-chain traversal

1 participant