On Sun, Jun 21, 2026 at 05:31:21PM +0530, Nithurshen wrote:
> Currently, fsck.erofs traverses the filesystem tree and verifies
> inodes synchronously on the main thread. While decompression
> compute is offloaded, the main thread remains a bottleneck
> during the I/O-heavy directory walk.
> 
> This patch parallelizes the directory traversal and inode
> extraction processes. To achieve this safely, the globally shared
> fsckcfg.extract_path and fsckcfg.dirstack states are decoupled
> and localized into individual struct erofsfsck_inode_task
> payloads, which are deep-copied and handed off to the worker
> pool. Global statistics and hardlink tables are secured using
> native erofs_mutex_t primitives.
> 
> To prevent thread pool exhaustion deadlocks—where workers
> processing a deep directory tree occupy all available execution
> slots and block on erofs_cond_wait, starving their own spawned
> decompression tasks—this patch introduces a dedicated
> erofs_traverse_wq. By isolating the producers (traversal and
> verification) from the consumers (pcluster decompression), the
> pipeline avoids gridlock.
> 
> Signed-off-by: Nithurshen <[email protected]>

I really hope you could parallelize the inodes in a single directory
first, and get a minimal commit and show the improvement.

And try to improve parallelization between directories.

The priciple is to keep each patch small so that it's more reviewable
and has low risky.

Also it seems that you could make mutex protection in seperate commits
too so it's also easier to review.

Thanks,
Gao Xiang 

Reply via email to