Skip to content

Disable overlayfs features not used by Docker#2773

Merged
agners merged 1 commit intohome-assistant:devfrom
agners:disable-overlayfs-features
Sep 26, 2023
Merged

Disable overlayfs features not used by Docker#2773
agners merged 1 commit intohome-assistant:devfrom
agners:disable-overlayfs-features

Conversation

@agners
Copy link
Member

@agners agners commented Sep 26, 2023

Currently CONFIG_OVERLAY_FS_METACOPY and CONFIG_OVERLAY_FS_REDIRECT_DIR kernel options are enabled but not preferred by Docker. The metadata copy feature is disabled by default, and also not actively used by the overlayfs2 driver (see moby/moby@2c3d1f7). So the metadata copy config is not really problematic per se. However, it enables the redirect_dir feature. And a kernel which has the redirect_dir feature compiled in also enables it by default. This actually makes the overlayfs2 driver to fallback to naive diff, which is, from what I understand, slower than the overlayfs native diff (see also moby/moby@49c3a7c). The Docker daemon is also reporting this on startup:

Not using native diff for overlay2, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled

Currently CONFIG_OVERLAY_FS_METACOPY is enabled, and it also enables CONFIG_OVERLAY_FS_REDIRECT_DIR. There was already a previous attempt to disable the latter (see #2067).

Disable both configs explicitly until Docker is able to use them.

Currently `CONFIG_OVERLAY_FS_METACOPY` and
`CONFIG_OVERLAY_FS_REDIRECT_DIR` kernel options are enabled but not
preferred by Docker. The metadata copy feature is disabled by default,
and also not actively used by the overlayfs2 driver (see
moby/moby@2c3d1f7).
So the metadata copy config is not really problematic per se. However,
it enables the redirect_dir feature. And a kernel which has the
redirect_dir feature compiled in also enables it by default. This
actually makes the overlayfs2 driver to fallback to naive diff, which
is, from what I understand, slower than the overlayfs native diff (see
also
moby/moby@49c3a7c).
The Docker daemon is also reporting this on startup:

  Not using native diff for overlay2, this may cause degraded performance
  for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled

Currently `CONFIG_OVERLAY_FS_METACOPY` is enabled, and it also enables
`CONFIG_OVERLAY_FS_REDIRECT_DIR`. There was already a previous attempt
to disable the latter (see home-assistant#2067).

Disable both configs explicitly until Docker is able to use them.
@agners agners force-pushed the disable-overlayfs-features branch from 9592a26 to 323c1a7 Compare September 26, 2023 12:07
@agners agners merged commit 39e867c into home-assistant:dev Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant