Skip to content

erofs-snapshotter: make IMMUTABLE_FL optional to recover performance#12072

Merged
fuweid merged 1 commit intocontainerd:mainfrom
erofs:erofs-snapshotter
Jul 11, 2025
Merged

erofs-snapshotter: make IMMUTABLE_FL optional to recover performance#12072
fuweid merged 1 commit intocontainerd:mainfrom
erofs:erofs-snapshotter

Conversation

@hsiangkao
Copy link
Copy Markdown
Member

@hsiangkao hsiangkao commented Jul 9, 2025

Enabling the IMMUTABLE_FL file attribute causes dirty data to be flushed synchronously at least on EXT4[1], which can greatly impact container launch performance. In contrast, the overlayfs snapshotter does not use syncfs by default.

Most users may not need IMMUTABLE_FL, let's make IMMUTABLE_FL optional to align with the behavior of the overlayfs snapshotter and recover the original performance.

  1. containerd toml file:
  [plugins."io.containerd.differ.v1.erofs"]
    mkfs_options = ["-T0", "--mkfs-time", "--sort=none"]
  1. tensorflow image
    Test commands:
$ nerdctl image pull --snapshotter=X --unpack="false" tensorflow/tensorflow:2.19.0
$ time nerdctl container --snapshotter=X run -d tensorflow/tensorflow:2.19.0 /bin/sh

Results:

 overlayfs                 | 0m18.748s
 erofs (no IMMUTABLE_FL)   | 0m10.090s
 erofs (with IMMUTABLE_FL) | 0m21.074s
  1. ubuntu 22.04 image
    Test commands:
$ nerdctl image pull --snapshotter=X --unpack="false" ubuntu:22.04
$ time nerdctl container --snapshotter=X run -d ubuntu:22.04 /bin/sh

Results:

 overlayfs                 | 0m1.147s
 erofs (no IMMUTABLE_FL)   | 0m0.795s
 erofs (with IMMUTABLE_FL) | 0m1.094s

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/ioctl.c?h=v6.15#n636

@hsiangkao
Copy link
Copy Markdown
Member Author

@github-project-automation github-project-automation bot moved this from Needs Triage to Needs Update in Pull Request Review Jul 9, 2025
@hsiangkao
Copy link
Copy Markdown
Member Author

Hi @cpuguy83 @AkihiroSuda could you take a look again? Cc @dmcgowan @fuweid @djdongjin

Enabling the IMMUTABLE_FL file attribute causes dirty data to be
flushed synchronously at least on EXT4, which can greatly impact
container launch performance.  In contrast, the overlayfs snapshotter
does not use syncfs by default.

Most users may not need IMMUTABLE_FL, let's make IMMUTABLE_FL optional
to align with the behavior of the overlayfs snapshotter and recover the
original performance.

1. tensorflow

Test commands:
$ nerdctl image pull --snapshotter=X --unpack="false" tensorflow/tensorflow:2.19.0
$ time nerdctl container --snapshotter=X run -d tensorflow/tensorflow:2.19.0 /bin/sh

Results:
 overlayfs                 | 0m18.748s
 erofs (no IMMUTABLE_FL)   | 0m10.090s
 erofs (with IMMUTABLE_FL) | 0m21.074s

2. ubuntu 22.04

Test commands:
$ nerdctl image pull --snapshotter=X --unpack="false" ubuntu:22.04
$ time nerdctl container --snapshotter=X run -d ubuntu:22.04 /bin/sh

Results:
 overlayfs                 | 0m1.147s
 erofs (no IMMUTABLE_FL)   | 0m0.795s
 erofs (with IMMUTABLE_FL) | 0m1.094s

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
@github-project-automation github-project-automation bot moved this from Needs Update to Review In Progress in Pull Request Review Jul 10, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Jul 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 10, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Jul 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 11, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Jul 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 11, 2025
@hsiangkao
Copy link
Copy Markdown
Member Author

hsiangkao commented Jul 11, 2025

@AkihiroSuda need another try, it falls into flakyness sadly. :(

@fuweid fuweid added this pull request to the merge queue Jul 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 11, 2025
@fuweid fuweid added this pull request to the merge queue Jul 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 11, 2025
@fuweid fuweid added this pull request to the merge queue Jul 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 11, 2025
@fuweid fuweid added this pull request to the merge queue Jul 11, 2025
Merged via the queue into containerd:main with commit b02ca39 Jul 11, 2025
52 checks passed
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Pull Request Review Jul 11, 2025
@hsiangkao
Copy link
Copy Markdown
Member Author

(... finally... I will try to cherry-pick it into 2.1 later since it impacts launch performance.)

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants