Re: [PATCH] erofs-utils: fsck: add concurrent extraction and decompression
Gao Xiang <[email protected]> Fri, 3 Jul 2026 02:20:35 +0800
| Newsgroups | org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <[email protected]> |
On 2026/7/2 20:59, Nithurshen Karthikeyan wrote: > On Thu, 2 Jul, 2026, 18:24 Gao Xiang, <[email protected]> wrote: > >> >> >> On 2026/7/2 16:10, Nithurshen wrote: >>> This patch introduces a multi-threaded pipeline for fsck.erofs, >>> combining parallel directory traversal with background pcluster >>> decompression to significantly reduce extraction time. >>> >>> Key architectural changes include: >>> >>> - Thread-Safe State: Removes the global dirstack array and >>> fsckcfg.extract_path. These are replaced with per-task localized >>> paths and thread-local linked lists to eliminate data races. >>> - Concurrent Traversal: Refactors erofsfsck_dirent_iter to allocate >>> task structures and dispatch inode processing to a background >>> workqueue (z_erofs_mt_wq). >>> - Asynchronous Decompression: Introduces z_erofs_mt_read_ctx to >>> batch pcluster reads and decouple decompression from main I/O. >>> Limits batch size dynamically (32 for LZ4, 8 for compute-heavy >>> algorithms) to balance CPU cache hits and memory overhead. >>> - Memory & Deadlock Safety: Implements inline backpressure during >>> directory iteration. If pending inodes exceed workqueue capacity, >>> execution falls back to synchronous processing to prevent >>> recursive thread-pool starvation and unbounded memory growth. >>> - Synchronization Primitives: Adds portable condition variable >>> wrappers (erofs_cond_t) to ensure the main thread safely waits >>> for all pending background inodes before exiting. >>> >>> Signed-off-by: Nithurshen <[email protected]> >> >> What's the relationship with the previous two patches? >> > > I made then into one atomic patch, since you wanted them merged at once. Nope, I didn't want that, I suggested you benchmark each patch. But it doesn't mean the patches should be merged. The merge meant merging commits to erofs-utils. Thanks, Gao Xiang > > Thanks, > Nithurshen > > Thanks, >> Gao Xiang >> >