Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4473259rdb; Mon, 11 Dec 2023 23:36:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOECmkLbKU47H0TC3PL3oWB4NgWhmuQD55Ia9jnNIZ8zIfOuQyNNWF4/q8v6YghRhv7MHe X-Received: by 2002:a05:6a20:728f:b0:190:a06:ddf1 with SMTP id o15-20020a056a20728f00b001900a06ddf1mr3315466pzk.66.1702366573780; Mon, 11 Dec 2023 23:36:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702366573; cv=none; d=google.com; s=arc-20160816; b=R0wkbfEuQSuixR6KrJz8GVsDk6VcYZ4yPS1HAxeXh6qNZM60fAG2Tw17LJaF6kpSpb 9vm6sdLca26e2X2C1BqnPBzzuuodM0O7lFUiDJgHz41nC5hn1t/TlSTFSN01vk7oOkl0 920zPtBYJ7VLl4jx6FhCd192Qq1/GJ/3JIiquzesXOPtjKXSqDHogbzRDyICA/cORKsE QE3b3QVidNTkvQO4iVp26I6JgxG+fzOp78Hd/NX9ZDsssCK1dZFgJgnja/GMt45zDoWW T9cATt0SQg+MxnCW1Brt2Q6G6D2pqkzEai2KE3Ue2aYDFSQNOfC/1GRSNvbwoQN1mq0c YagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AcYhiiH7fhawjVuelCjJeq52YfhKQC6amDLwlqcKTwo=; fh=AAptBPbl8vOSpwwxMk3cirpNIR8n1xz2eOWOIM7fZEM=; b=jYEAtfIlR9UdWnNZtQnbYAO0y4RAorTL5eqfgX++Wd3lf1NJicpq0woke8iIPk305Y fr8Zj1yQcVWDjEi13v9y1FzXb8hAT8ebWkL/jE/YUqvFZ6OBcLVBwDQPcOzehkBsfHtE 45+/SkyOqKONkms3fsTcc13cLBtmgeoCzQYFC7haeO7XCOlrsbwRATrzLKEYbXbCBiE5 V2sadX7L3jh+GzTqE05Cp7jC1in1Qa6XTTV2WssnS+mu22u0AljtSEw0MnBPB4aRDGaM WXHvhAIbgR4PVoHgk4jVNBUfi8JHV4aVN1g+hJjPWhA3EdCfITv+/FLoxO6sGY+dhmZz vo2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=rhyiQAuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u13-20020a17090ae00d00b00286b69f3ba7si8541086pjy.23.2023.12.11.23.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:36:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=rhyiQAuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 466D2807E42E; Mon, 11 Dec 2023 23:35:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjLLHfe (ORCPT + 99 others); Tue, 12 Dec 2023 02:35:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjLLHfc (ORCPT ); Tue, 12 Dec 2023 02:35:32 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80730AB; Mon, 11 Dec 2023 23:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=AcYhiiH7fhawjVuelCjJeq52YfhKQC6amDLwlqcKTwo=; b=rhyiQAuAA9SMhBFiM8MkZ6S7/n 2VqgqBenkm2syZdsR1Rs17Wb5BaWMmD22pzkTDL6hYP58KirLwQ8G4Hx2+CujuFMTHiC1xqZtL6ud 5Ol2yLOF+hnaxCoUbzWseGsOuFgtT+oO9YvjDwYL/VW46twsaJSB7qVoUPFilAFQoF9N7XDWmhEV7 C5wYXOnPMOjocN4mK5mn4YHhT3wXd4c1mrJdmhV6LrfjCdOb6tTlbXN0mKGhssdilbPbUbACzCEKr ugWu78xhg3L50aQSFtgRwv7Hi+deVFSZtKpq51xv0R9033QmVrF2kw2P7atuEz4Z38Ue87RHO6TTv H64AJwtQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rCxIh-00AwT9-2z; Tue, 12 Dec 2023 07:35:31 +0000 Date: Mon, 11 Dec 2023 23:35:31 -0800 From: Christoph Hellwig To: Gao Xiang Cc: Eric Curtin , Linux Kernel Mailing List , linux-unionfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, Daan De Meyer , Stephen Smoogen , Yariv Rachmani , Daniel Walsh , Douglas Landgraf , Alexander Larsson , Colin Walters , Brian Masney , Eric Chanudet , Pavol Brilla , Lokesh Mandvekar , Petr =?utf-8?Q?=C5=A0abata?= , Lennart Poettering , Luca Boccassi , Neal Gompa , nvdimm@lists.linux.dev Subject: Re: [RFC KERNEL] initoverlayfs - a scalable initial filesystem Message-ID: References: <941aff31-6aa4-4c37-bb94-547c46250304@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <941aff31-6aa4-4c37-bb94-547c46250304@linux.alibaba.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 23:35:50 -0800 (PST) On Tue, Dec 12, 2023 at 08:50:56AM +0800, Gao Xiang wrote: > For non-virtualization cases, I guess you could try to use `memmap` > kernel option [2] to specify a memory region by bootloaders which > contains an EROFS rootfs and a customized init for booting as > erofs+overlayfs at least for `initoverlayfs`. The main benefit is > that the memory region specified by the bootloader can be directly > used for mounting. But I never tried if this option actually works. > > Furthermore, compared to traditional ramdisks, using direct address > can avoid page cache totally for uncompressed files like it can > just use unencoded data as mmaped memory. For compressed files, it > still needs page cache to support mmaped access but we could adapt > more for persistent memory scenarios such as disable cache > decompression compared to previous block devices. > > I'm not sure if it's worth implementing this in kernelspace since > it's out of scope of an individual filesystem anyway. IFF the use case turns out to be generally useful (it looks quite convoluted and odd to me), we could esily do an initdax concept where a chunk of memory passed by the bootloader is presented as a DAX device properly without memmap hacks.