From 39e867c3521ca13efc7b7131e0bc047852dd70b2 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 26 Sep 2023 14:54:01 +0200 Subject: [PATCH] Disable overlayfs features not used by Docker (#2773) 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 https://github.com/moby/moby/commit/2c3d1f7b4be754abf4c3a169aa19db0792847fc6). 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 https://github.com/moby/moby/commit/49c3a7c4bac2877265ef8c4eaf210159560f08b4). 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. --- buildroot-external/kernel/docker.config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildroot-external/kernel/docker.config b/buildroot-external/kernel/docker.config index 40b07857f..458413855 100644 --- a/buildroot-external/kernel/docker.config +++ b/buildroot-external/kernel/docker.config @@ -75,7 +75,8 @@ CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y CONFIG_OVERLAY_FS=y -CONFIG_OVERLAY_FS_METACOPY=y +# CONFIG_OVERLAY_FS_METACOPY is not set +# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set CONFIG_CRYPTO_CCM=m CONFIG_CRYPTO_GCM=m