Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5378161rwd; Wed, 24 May 2023 00:25:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ444uoT4Y5plyywHKQirJFjks2LGU086JwcsjY1GzQMoNmnS+u2E/9dBbR29Wle29NrnY82 X-Received: by 2002:a17:903:245:b0:1ac:5382:6e24 with SMTP id j5-20020a170903024500b001ac53826e24mr18969664plh.10.1684913137475; Wed, 24 May 2023 00:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684913137; cv=none; d=google.com; s=arc-20160816; b=0XI890N24+eAfoM+ktp1La10Wm6GIYzIo2jry+wBUsZUkl4BiK2TTgA1EsD3D3utVV N7rTzj//IGjcuNe1huuriNl7S7MtDHGQ0A2FyUH87wrZe1mfmpHij2yOfD4bWvVYMiqR BSA2COOYBtwH0TGdOb1hlzQPwUfjclmDyyCVWhcZM/5bJdu/6HckRnzsgtt6S3jTuTY1 nWhwrRmPvHDZ2HgDP05StBf3zbbBVMoerTpfVXIwOyQqAAuWtGx/Rbk4QRdvAeliy2jh 4QBCyIz8hZo1AUNg+jxmeackKTXmgJYY1kWkg0EdjLuaA2f4tCaYCrI7awcXqJ+dwxp1 eJzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=l9ksl2pb1rC7B7vlfRn1WRL4RebTd7RvWjthLpFDpZU=; b=MQMwjv9AkmGEfiENFWzW0r5F07Awnln1F7lNMj9StoU46UB7cEj4oiNcIBYjikfpQl O8dPePMMzQdLHU+TIbIbau2haASjDBvNsGLuYl0qngCYzpbmzCA462brwwuGPoV9Giqy TmAk+1AyUpOceba7ItogKXX12tsCCn+1V3nv/+haIe0oxcsMEhRUJBmYTBf0e4bkryNw V6izUNeOEXSpeDsOSlah8qKMxS8P3bnHDT7bMJOZnXCHHXU5STR83VAvI6MdXK1cH/8u szcQPErQDovGf6BmOsKUwc40PYFZiEEUuUvRAI04AAw4DC8aPTE86p8NYWqhYvuKOQC7 WLUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a170902a51300b001ab29399c72si7466583plq.502.2023.05.24.00.25.25; Wed, 24 May 2023 00:25:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233581AbjEXHPs (ORCPT + 99 others); Wed, 24 May 2023 03:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240173AbjEXHPT (ORCPT ); Wed, 24 May 2023 03:15:19 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47B5EB3 for ; Wed, 24 May 2023 00:13:54 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VjN6v8P_1684912430; Received: from 30.97.48.247(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VjN6v8P_1684912430) by smtp.aliyun-inc.com; Wed, 24 May 2023 15:13:51 +0800 Message-ID: Date: Wed, 24 May 2023 15:13:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: dm overlaybd: targets mapping OverlayBD image To: Alexander Larsson , Mike Snitzer , Du Rui Cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org, Alasdair Kergon , Giuseppe Scrivano References: <9505927dabc3b6695d62dfe1be371b12f5bdebf7.1684491648.git.durui@linux.alibaba.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/5/24 23:43, Alexander Larsson wrote: > On Tue, May 23, 2023 at 7:29 PM Mike Snitzer wrote: >> >> On Fri, May 19 2023 at 6:27P -0400, >> Du Rui wrote: >> >>> OverlayBD is a novel layering block-level image format, which is design >>> for container, secure container and applicable to virtual machine, >>> published in USENIX ATC '20 >>> https://www.usenix.org/system/files/atc20-li-huiba.pdf >>> >>> OverlayBD already has a ContainerD non-core sub-project implementation >>> in userspace, as an accelerated container image service >>> https://github.com/containerd/accelerated-container-image >>> >>> It could be much more efficient when do decompressing and mapping works >>> in the kernel with the framework of device-mapper, in many circumstances, >>> such as secure container runtime, mobile-devices, etc. >>> >>> This patch contains a module, dm-overlaybd, provides two kinds of targets >>> dm-zfile and dm-lsmt, to expose a group of block-devices contains >>> OverlayBD image as a overlaid read-only block-device. >>> >>> Signed-off-by: Du Rui >> >> > > A long long time ago I wrote a docker container image based on > dm-snapshot that is vaguely similar to this one. It is still > available, but nobody really uses it. It has several weaknesses. First > of all the container image is an actual filesystem, so you need to > pre-allocate a fixed max size for images at construction time. > Secondly, all the lvm volume changes and mounts during runtime caused > weird behaviour (especially at scale) that was painful to manage (just > search the docker issue tracker for devmapper backend). In the end > everyone moved to a filesystem based implementation (overlayfs based). Yeah, and I think reproducibility issue is another problem, which means it's quite hard to select a random fs without some change to get the best result. I do find these guys work on e2fsprogs again and again. I've already told them internally again and again, but.. They only focus on some minor points such as how to do I/O and CPU prefetch to get (somewhat) better performance and beat EROFS. I don't know, I have no enough time to even look into that whether this new kernel stuffs is fine: because of a very simplist idea: stacked storage overhead generally takes double runtime/memory footprints: filesystem + block drivers > >> I appreciate that this work is being done with an eye toward >> containerd "community" and standardization but based on my limited >> research it appears that this format of OCI image storage/use is only >> used by Alibaba? (but I could be wrong...) >> >> But you'd do well to explain why the userspace solution isn't >> acceptable. Are there security issues that moving the implementation >> to kernel addresses? >> >> I also have doubts that this solution is _actually_ more performant >> than a proper filesystem based solution that allows page cache sharing >> of container image data across multiple containers. > > This solution doesn't even allow page cache sharing between shared > layers (like current containers do), much less between independent > layers. > >> There is an active discussion about, and active development effort >> for, using overlayfs + erofs for container images. I'm reluctant to >> merge this DM based container image approach without wider consensus >> from other container stakeholders. >> >> But short of reaching wider consensus on the need for these DM >> targets: there is nothing preventing you from carrying these changes >> in your alibaba kernel. > > Erofs already has some block-level support for container images (with > nydus), and composefs works with current in-kernel EROFS+overlayfs. > And this new approach doesn't help for the IMHO current weak spot we > have, which is unprivileged container images. > > Also, while OCI artifacts can be used to store any kind of image > formats (or any other kind of file) I think for an actual standardized > new image format it would be better to work with the OCI org to come > up with a OCI v2 standard image format. Agreed, I hope you guys could actually sit down and evaluate a proper solution on the next OCI v2, currently I know there are: - Composefs - (e)stargz https://github.com/containerd/stargz-snapshotter - Nydus https://github.com/containerd/nydus-snapshotter - OverlayBD https://github.com/containerd/accelerated-container-image - SOCI https://github.com/awslabs/soci-snapshotter - Tarfs - (maybe even more..) Honestly, I do think OSTree/Composefs is the best approach for now for deduplication and page cache sharing (due to kernel limitation of page cache sharing and overlayfs copyup limitation). I'm too tired of container image stuffs honestly. Too much unnecessary manpower waste. Thanks, Gao Xiang > > But, I don't really speak for the block layer developers, so take my > opinions with a pinch of salt. >