[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f4f18b4-130e-ce51-3149-8a1ad348dc2a@infradead.org>
Date: Thu, 8 Oct 2020 18:26:35 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: yulei.kernel@...il.com, akpm@...ux-foundation.org,
naoya.horiguchi@....com, viro@...iv.linux.org.uk,
pbonzini@...hat.com
Cc: linux-fsdevel@...r.kernel.org, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, xiaoguangrong.eric@...il.com,
kernellwp@...il.com, lihaiwei.kernel@...il.com,
Yulei Zhang <yuleixzhang@...cent.com>
Subject: Re: [PATCH 35/35] Add documentation for dmemfs
On 10/8/20 12:54 AM, yulei.kernel@...il.com wrote:
> From: Yulei Zhang <yuleixzhang@...cent.com>
>
> Introduce dmemfs.rst to document the basic usage of dmemfs.
>
Please add dmemfs as an entry in Documentation/filesystems/index.rst also.
> Signed-off-by: Yulei Zhang <yuleixzhang@...cent.com>
> ---
> Documentation/filesystems/dmemfs.rst | 59 ++++++++++++++++++++++++++++
> 1 file changed, 59 insertions(+)
> create mode 100644 Documentation/filesystems/dmemfs.rst
>
> diff --git a/Documentation/filesystems/dmemfs.rst b/Documentation/filesystems/dmemfs.rst
> new file mode 100644
> index 000000000000..cbb4cc1ed31d
> --- /dev/null
> +++ b/Documentation/filesystems/dmemfs.rst
> @@ -0,0 +1,57 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +=====================================
> +The Direct Memory Filesystem - DMEMFS
> +=====================================
> +
> +
> +.. Table of contents
> +
> + - Overview
> + - Compilation
> + - Usage
> +
> +Overview
> +========
> +
> +Dmemfs (Direct Memory filesystem) is device memory or reserved
> +memory based filesystem. This kind of memory is special as it
> +is not managed by kernel and it is without 'struct page'. Therefore
> +it can save extra memory from the host system for various usage,
usages,
> +especially for guest virtual machines.
> +
> +It uses a kernel boot parameter ``dmem=`` to reserve the system
> +memory when the host system boots up, the details can be checked
up. The details
> +in /Documentation/admin-guide/kernel-parameters.txt.
> +
> +Compilation
> +===========
> +
> +The filesystem should be enabled by turning on the kernel configuration
> +options::
> +
> + CONFIG_DMEM_FS - Direct Memory filesystem support
> + CONFIG_DMEM - Allow reservation of memory for dmem
Hm, is there a good reason for having both of these options?
Is one of them usable without the other one?
If not, there should only be one Kconfig option for DMEMFS.
> +
> +
> +Additionally, the following can be turned on to aid debugging::
> +
> + CONFIG_DMEM_DEBUG_FS - Enable debug information for dmem
> +
> +Usage
> +========
> +
> +Dmemfs supports mapping ``4K``, ``2M`` and ``1G`` size of pages to
> +the userspace, for example ::
> +
> + # mount -t dmemfs none -o pagesize=4K /mnt/
> +
> +The it can create the backing storage with 4G size ::
Then
> +
> + # truncate /mnt/dmemfs-uuid --size 4G
> +
> +To use as backing storage for virtual machine starts with qemu, just need
> +to specify the memory-backed-file in the qemu command line like this ::
> +
> + # -object memory-backend-file,id=ram-node0,mem-path=/mnt/dmemfs-uuid \
> + share=yes,size=4G,host-nodes=0,policy=preferred -numa node,nodeid=0,memdev=ram-node0
>
--
~Randy
Powered by blists - more mailing lists