All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nithurshen <nithurshen.dev@gmail.com>
To: nithurshen.dev@gmail.com
Cc: hsiangkao@linux.alibaba.com, linux-erofs@lists.ozlabs.org,
	xiang@kernel.org
Subject: [PATCH 1/2 v3] fsck.erofs: add multi-threaded decompression
Date: Mon,  6 Jul 2026 11:40:48 +0530	[thread overview]
Message-ID: <20260706061048.16349-1-nithurshen.dev@gmail.com> (raw)
In-Reply-To: <20260706060525.14018-1-nithurshen.dev@gmail.com>

Hi Xiang,

Please find the updated multi-threaded decompression implementation for
fsck.erofs. This version introduces an algorithm-aware asynchronous
worker pool, dynamically sized based on system CPUs, to significantly
accelerate the extraction of computationally expensive images.

Benchmarks were performed on an ARM64 environment, extracting the 8.2 GB
Linux repository downloaded from Github.

Extraction Time (Seconds):

| Algorithm | 4k | 8k | 16k | 32k | 64k |
| --- | --- | --- | --- | --- | --- |
| lz4hc(MT) | 9.36 | 8.31 | 8.27 | 8.54 | 6.94 |
| lz4hc(ST) | 4.40 | 5.77 | 3.65 | 5.45 | 3.36 |
| zstd(MT) | 9.26 | 8.68 | 8.89 | 8.11 | 7.94 |
| zstd(ST) | 5.23 | 4.52 | 4.62 | 4.11 | 4.02 |
| lzma(MT) | 23.72 | 24.79 | 25.90 | 26.92 | 27.77 |
| lzma(ST) | 56.37 | 65.06 | 71.07 | 74.69 | 81.63 |

Performance Analysis:
The implementation provides a significant speedup for LZMA (up to 2.9x)
as the heavy decompression workload effectively amortizes the thread
synchronization overhead.

However, for fast algorithms like LZ4 and ZSTD, the current MT overhead
(futex contention and scheduling) leads to slower performance compared
to the synchronous baseline.

I have tried various batch sizes for fast algorithms, but the time did
not improve. (I tried from 32 to 256 batch sizes)

Can we fall back to synchronous extraction here?

Verification:

* Deadlocks/Race Conditions: Verified via GDB backtrace analysis and
stress testing.
* Memory Leaks: Verified via rigorous buffer ownership tracking and
ensuring all task resources are cleaned up upon worker completion.
* Integrity: All configurations passed bit-for-bit integrity checks
between the extracted and original directory for all algorithms and
chunk sizes.

All concurrency primitives and memory paths have been verified to the
best of my knowledge.

Thanks,
Nithurshen


  reply	other threads:[~2026-07-06  6:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-21 12:01 [PATCH 0/2] fsck.erofs: implement multi-threaded extraction Nithurshen
2026-06-21 12:01 ` [PATCH 1/2] fsck.erofs: add multi-threaded decompression Nithurshen
2026-06-22  2:08   ` Gao Xiang
2026-06-29  9:55   ` [PATCH 1/2 v2] " Nithurshen
2026-07-05 14:00     ` Gao Xiang
2026-07-06  6:05   ` [PATCH 1/2 v3] " Nithurshen
2026-07-06  6:10     ` Nithurshen [this message]
2026-07-08  2:31       ` Gao Xiang
2026-07-13  7:02     ` [PATCH 1/2 v4] " Nithurshen
2026-06-21 12:01 ` [PATCH 2/2] fsck.erofs: implement concurrent directory traversal Nithurshen
2026-07-05 14:05   ` Gao Xiang
2026-07-14  1:10   ` [PATCH v5] fsck.erofs: add multi-threaded decompression Nithurshen
2026-07-14  1:18     ` Nithurshen Karthikeyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260706061048.16349-1-nithurshen.dev@gmail.com \
    --to=nithurshen.dev@gmail.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=xiang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.