From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rhyiQAuA" 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> Precedence: bulk X-Mailing-List: linux-unionfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.