Skip to content

Commit

Permalink
erofs-utils: enable multi-threaded support for -Eall-fragments
Browse files Browse the repository at this point in the history
Since `-Eall-fragments` packs the whole data into the special inode,
it's possible to use the multi-threaded compression for this.

Some users may be interested in `-Eall-fragments` for extreme
compression anyway.

Signed-off-by: Gao Xiang <[email protected]>
Reviewed-by: Sandeep Dhavale <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
hsiangkao committed Aug 8, 2024
1 parent aa77424 commit 10c1590
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,15 +1763,16 @@ int z_erofs_compress_init(struct erofs_sb_info *sbi, struct erofs_buffer_head *s

z_erofs_mt_enabled = false;
#ifdef EROFS_MT_ENABLED
if (cfg.c_mt_workers > 1 && (cfg.c_dedupe || cfg.c_fragments)) {
if (cfg.c_mt_workers >= 1 && (cfg.c_dedupe ||
(cfg.c_fragments && !cfg.c_all_fragments))) {
if (cfg.c_dedupe)
erofs_warn("multi-threaded dedupe is NOT implemented for now");
if (cfg.c_fragments)
erofs_warn("multi-threaded fragments is NOT implemented for now");
cfg.c_mt_workers = 0;
}

if (cfg.c_mt_workers > 1) {
if (cfg.c_mt_workers >= 1) {
ret = erofs_alloc_workqueue(&z_erofs_mt_ctrl.wq,
cfg.c_mt_workers,
cfg.c_mt_workers << 2,
Expand Down

0 comments on commit 10c1590

Please sign in to comment.