Kamalesh Babulal (2): cgroup: Check for ret during cgroup1_base_files cft addition cgroup: use legacy_name for cgroup v1 disable info
Ming Lei (1): blk-cgroup: bypass blkcg_deactivate_policy after destroying
block/blk-cgroup.c | 13 +++++++++++++ kernel/cgroup/cgroup.c | 8 +++++--- 2 files changed, 18 insertions(+), 3 deletions(-)
From: Kamalesh Babulal kamalesh.babulal@oracle.com
mainline inclusion from mainline-v6.7-rc1 commit fd55c0adb46a44c9a0630dc32509e4733c290103 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I91BXW
----------------------------------------------------------------------
There is no check for possible failure while populating cgroup1_base_files cft in css_populate_dir(), like its cgroup v2 counter parts cgroup_{base,psi}_files. In case of failure, the cgroup might not be set up right. Add ret value check to return on failure.
Signed-off-by: Kamalesh Babulal kamalesh.babulal@oracle.com Signed-off-by: Tejun Heo tj@kernel.org Signed-off-by: Chen Ridong chenridong@huawei.com --- kernel/cgroup/cgroup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index e342774b9215..c9f2f0c0db9e 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1733,8 +1733,10 @@ static int css_populate_dir(struct cgroup_subsys_state *css) return ret; } } else { - cgroup_addrm_files(css, cgrp, - cgroup1_base_files, true); + ret = cgroup_addrm_files(css, cgrp, + cgroup1_base_files, true); + if (ret < 0) + return ret; } } else { list_for_each_entry(cfts, &css->ss->cfts, node) {
From: Ming Lei ming.lei@redhat.com
mainline inclusion from mainline-v6.7-rc3 commit e63a57303599b17290cd8bc48e6f20b24289a8bc category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I91BXW
----------------------------------------------------------------------
blkcg_deactivate_policy() can be called after blkg_destroy_all() returns, and it isn't necessary since blkg_destroy_all has covered policy deactivation.
Signed-off-by: Ming Lei ming.lei@redhat.com Link: https://lore.kernel.org/r/20231117023527.3188627-4-ming.lei@redhat.com Signed-off-by: Jens Axboe axboe@kernel.dk Signed-off-by: Chen Ridong chenridong@huawei.com --- block/blk-cgroup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index a1f2f316e88d..8f5d284dc073 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -577,6 +577,7 @@ static void blkg_destroy_all(struct gendisk *disk) struct request_queue *q = disk->queue; struct blkcg_gq *blkg, *n; int count = BLKG_DESTROY_BATCH_SIZE; + int i;
restart: spin_lock_irq(&q->queue_lock); @@ -602,6 +603,18 @@ static void blkg_destroy_all(struct gendisk *disk) } }
+ /* + * Mark policy deactivated since policy offline has been done, and + * the free is scheduled, so future blkcg_deactivate_policy() can + * be bypassed + */ + for (i = 0; i < BLKCG_MAX_POLS; i++) { + struct blkcg_policy *pol = blkcg_policy[i]; + + if (pol) + __clear_bit(pol->plid, q->blkcg_pols); + } + q->root_blkg = NULL; spin_unlock_irq(&q->queue_lock); }
From: Kamalesh Babulal kamalesh.babulal@oracle.com
mainline inclusion from mainline-v6.7-rc1 commit 27a6c5c50c4bb0c56296f01a3142db796bb01da1 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I91BXW
----------------------------------------------------------------------
cgroup v1 or v2 or both controller names can be passed as arguments to the 'cgroup_no_v1' kernel parameter, though most of the controller's names are the same for both cgroup versions. This can be confusing when both versions are used interchangeably, i.e., passing cgroup_no_v1=io
$ sudo dmesg |grep cgroup ... cgroup: Disabling io control group subsystem in v1 mounts cgroup: Disabled controller 'blkio'
Make it consistent across the pr_info()'s, by using ss->legacy_name, as the subsystem name, while printing the cgroup v1 controller disabling information in cgroup_init().
Signed-off-by: Kamalesh Babulal kamalesh.babulal@oracle.com Signed-off-by: Tejun Heo tj@kernel.org Signed-off-by: Chen Ridong chenridong@huawei.com --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index c9f2f0c0db9e..2d92c0ea15c0 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -6216,7 +6216,7 @@ int __init cgroup_init(void)
if (cgroup1_ssid_disabled(ssid)) pr_info("Disabling %s control group subsystem in v1 mounts\n", - ss->name); + ss->legacy_name);
cgrp_dfl_root.subsys_mask |= 1 << ss->id;
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/4537 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/4537 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N...