Unverified Commit 5d88ebb9 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15323 v6 Add TrIO support in EROFS

Merge Pull Request from: @ci-robot 
 
PR sync from: Hongbo Li <lihongbo22@huawei.com>
https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/NMI47HY3T7HXK4PJXMRX54DCPVTZISWD/ 
TrIO can accelerate the cold start of containers during on-demand loading.
It aggregates the read I/O operations required for container runtime
during the first container launch. In the following startups, TrIO pulls
the necessary I/O data to the container node in a single large I/O
operation and uses this I/O information to construct the runtime rootfs.
By improving the efficiency of network I/O, TrIO speeds up container
startup in on-demand loading scenarios.

TrIO consists of both kernel-space and user-space code. The kernel-space
code has been adapted at the overlayfs layer, introducing the
CONFIG_EROFS_TRIO configuration to provide isolation. The user-space
code requires adaptation by the user, and detailed usage methods are
introduced in the tools/trio/README.md section. Patches 1~2 correspond
to the kernel adaptations, while patches 3~4 are the scripts and best
practices that TrIO relies on for its operation.

v6:
  - Add folio_put after filemap_get_folio.
  - Filter trace with lowerdir

v5:
  - Adapt to the large folio tracepoint in erofs.
  - Adapt to the multiple type of page size (4k and 64k).

v4:
  - Avoid the memleak of meta_buf.
  - Fix some exception handle from reviewer's suggestions.
  - Use spinlock in kprobe context.

v3:
  - Obtain and keep the trio_object in open.
  - Only close readahead in trio case.

Hongbo Li (4):
  erofs:trio: Add trio_manager in erofs
  erofs: trio: Support TrIO feature in erofs
  TrIO: Add tools for using TrIO
  TrIO: Add README.md

 
https://gitee.com/openeuler/release-management/issues/IBK2MJ 
 
Link:https://gitee.com/openeuler/kernel/pulls/15323

 

Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 9773fbed 5440a29d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7171,6 +7171,7 @@ CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
# CONFIG_EROFS_FS_ZIP is not set
CONFIG_EROFS_FS_ONDEMAND=y
# CONFIG_EROFS_TRIO is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V2=m
+1 −0
Original line number Diff line number Diff line
@@ -8349,6 +8349,7 @@ CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
# CONFIG_EROFS_FS_ZIP is not set
CONFIG_EROFS_FS_ONDEMAND=y
# CONFIG_EROFS_TRIO is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
# CONFIG_NFS_V2 is not set
+11 −0
Original line number Diff line number Diff line
@@ -125,6 +125,17 @@ config EROFS_FS_ONDEMAND

	  If unsure, say N.

config EROFS_TRIO
	bool "EROFS TrIO support"
	depends on EROFS_FS_ONDEMAND
	default n
	help
	  If this config option is enabled then erofs trio will be enable.
	  This is used for container cases to boost on-demand loading for
	  container's images.

	  If unsure, say N.

config EROFS_FS_PCPU_KTHREAD
	bool "EROFS per-cpu decompression kthread workers"
	depends on EROFS_FS_ZIP
+1 −0
Original line number Diff line number Diff line
@@ -7,3 +7,4 @@ erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o pcpubuf.o
erofs-$(CONFIG_EROFS_FS_ZIP_LZMA) += decompressor_lzma.o
erofs-$(CONFIG_EROFS_FS_ZIP_DEFLATE) += decompressor_deflate.o
erofs-$(CONFIG_EROFS_FS_ONDEMAND) += fscache.o
erofs-$(CONFIG_EROFS_TRIO) += trio_manager.o
+21 −1
Original line number Diff line number Diff line
@@ -198,6 +198,21 @@ static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)
	return ret;
}

static bool erofs_fscache_read_trio(struct erofs_fscache_request *primary)
{
	struct address_space *mapping = primary->mapping;
	loff_t pos = primary->start + primary->submitted;

	ssize_t ret = erofs_read_from_trio(mapping, pos,
					   primary->len - primary->submitted);
	if (ret > 0) {
		primary->submitted += ret;
		return true;
	}

	return false;
}

static int erofs_fscache_data_read_slice(struct erofs_fscache_request *primary)
{
	struct address_space *mapping = primary->mapping;
@@ -207,10 +222,15 @@ static int erofs_fscache_data_read_slice(struct erofs_fscache_request *primary)
	struct erofs_map_blocks map;
	struct erofs_map_dev mdev;
	struct iov_iter iter;
	loff_t pos = primary->start + primary->submitted;
	loff_t pos;
	size_t count;
	int ret;

	/* first try mapping in trio */
	if (erofs_fscache_read_trio(primary))
		return 0;

	pos = primary->start + primary->submitted;
	map.m_la = pos;
	ret = erofs_map_blocks(inode, &map);
	if (ret)
Loading