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

!3907 cgroup: Support iocost for cgroup v1

Merge Pull Request from: @ci-robot 
 
PR sync from: Li Nan <linan122@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/2W7OJMTZ7Q2M2GSJKF4TY2YECRFN5YNF/ 
Li Nan (2):
  cgroup: Support iocost for cgroup v1
  openeuler_defconfig: enable iocost in openeuler_defconfig for x86 and
    arm64


-- 
2.39.2
 
https://gitee.com/openeuler/kernel/issues/I8ND38 
 
Link:https://gitee.com/openeuler/kernel/pulls/3907

 

Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 73c55d5a 5abc6f88
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -875,6 +875,7 @@ CONFIG_MODPROBE_PATH="/sbin/modprobe"
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
@@ -890,7 +891,8 @@ CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
# CONFIG_BLK_CGROUP_IOLATENCY is not set
# CONFIG_BLK_CGROUP_FC_APPID is not set
# CONFIG_BLK_CGROUP_IOCOST is not set
CONFIG_BLK_CGROUP_IOCOST=y
CONFIG_BLK_CGROUP_LEGACY_IOCOST=y
# CONFIG_BLK_CGROUP_IOPRIO is not set
CONFIG_BLK_DEBUG_FS=y
CONFIG_BLK_DEBUG_FS_ZONED=y
+3 −1
Original line number Diff line number Diff line
@@ -940,6 +940,7 @@ CONFIG_MODPROBE_PATH="/sbin/modprobe"
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
@@ -955,7 +956,8 @@ CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
# CONFIG_BLK_CGROUP_IOLATENCY is not set
# CONFIG_BLK_CGROUP_FC_APPID is not set
# CONFIG_BLK_CGROUP_IOCOST is not set
CONFIG_BLK_CGROUP_IOCOST=y
CONFIG_BLK_CGROUP_LEGACY_IOCOST=y
# CONFIG_BLK_CGROUP_IOPRIO is not set
CONFIG_BLK_DEBUG_FS=y
CONFIG_BLK_DEBUG_FS_ZONED=y
+10 −0
Original line number Diff line number Diff line
@@ -188,6 +188,16 @@ config BLK_CGROUP_IOCOST
	distributes IO capacity between different groups based on
	their share of the overall weight distribution.

config BLK_CGROUP_LEGACY_IOCOST
	bool "Enable iocost in cgroup v1"
	default n
	depends on BLK_CGROUP_IOCOST=y
	help
	Enabling this option enables the .cost.weight interface for cost
	model based proportional IO control when cgroup is version 1.

	If unsure, say N.

config BLK_CGROUP_IOPRIO
	bool "Cgroup I/O controller for assigning an I/O priority class"
	depends on BLK_CGROUP
+27 −0
Original line number Diff line number Diff line
@@ -3490,6 +3490,30 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,
	return ret;
}

#ifdef CONFIG_BLK_CGROUP_LEGACY_IOCOST
static struct cftype ioc_legacy_files[] = {
	{
		.name = "cost.weight",
		.flags = CFTYPE_NOT_ON_ROOT,
		.seq_show = ioc_weight_show,
		.write = ioc_weight_write,
	},
	{
		.name = "cost.qos",
		.flags = CFTYPE_ONLY_ON_ROOT,
		.seq_show = ioc_qos_show,
		.write = ioc_qos_write,
	},
	{
		.name = "cost.model",
		.flags = CFTYPE_ONLY_ON_ROOT,
		.seq_show = ioc_cost_model_show,
		.write = ioc_cost_model_write,
	},
	{}
};
#endif

static struct cftype ioc_files[] = {
	{
		.name = "weight",
@@ -3514,6 +3538,9 @@ static struct cftype ioc_files[] = {

static struct blkcg_policy blkcg_policy_iocost = {
	.dfl_cftypes	= ioc_files,
#ifdef CONFIG_BLK_CGROUP_LEGACY_IOCOST
	.legacy_cftypes = ioc_legacy_files,
#endif
	.cpd_alloc_fn	= ioc_cpd_alloc,
	.cpd_free_fn	= ioc_cpd_free,
	.pd_alloc_fn	= ioc_pd_alloc,