hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/9840 ------------------ This reverts commit 43132396266db21803149f07afff112bc56f19a6. The rdtgroup_rename() operation for monitor group migration involves RMID free and reallocation under MPAM, which alters the RDT operational flow. Additionally, on kernfs_rename() failure, resctrl_find_free_rmid() is not properly rolled back. Since upstream MPAM does not yet fully support this functionality, the conditions for monitor group 'mv' operations are not currently met. Return -EPERM directly to disallow the operation. Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- fs/resctrl/internal.h | 1 - fs/resctrl/monitor.c | 2 +- fs/resctrl/rdtgroup.c | 20 +++----------------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h index 4c5ddd03ce08a..a5f35e72ebc69 100644 --- a/fs/resctrl/internal.h +++ b/fs/resctrl/internal.h @@ -299,6 +299,5 @@ bool has_busy_rmid(struct rdt_domain *d); void __check_limbo(struct rdt_domain *d, bool force_free); void rdt_staged_configs_clear(void); int resctrl_find_cleanest_closid(void); -struct rmid_entry *resctrl_find_free_rmid(u32 closid); #endif /* _FS_RESCTRL_INTERNAL_H */ diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index b3eb1a02ac607..e152c646f35b2 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -211,7 +211,7 @@ static struct rmid_entry *__resctrl_find_free_rmid(u32 closid) return ERR_PTR(-ENOSPC); } -struct rmid_entry *resctrl_find_free_rmid(u32 closid) +static struct rmid_entry *resctrl_find_free_rmid(u32 closid) { struct rmid_entry *err; int ret; diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 601c74e18315b..2fab48af47000 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -3864,8 +3864,6 @@ static void mongrp_reparent(struct rdtgroup *rdtgrp, list_move_tail(&rdtgrp->mon.crdtgrp_list, &new_prdtgrp->mon.crdtgrp_list); - free_rmid(rdtgrp->closid, rdtgrp->mon.rmid); - rdtgrp->mon.rmid = alloc_rmid(new_prdtgrp->closid); rdtgrp->mon.parent = new_prdtgrp; rdtgrp->closid = new_prdtgrp->closid; @@ -3880,11 +3878,13 @@ static int rdtgroup_rename(struct kernfs_node *kn, { struct kernfs_node *kn_parent; struct rdtgroup *new_prdtgrp; - struct rmid_entry *entry; struct rdtgroup *rdtgrp; cpumask_var_t tmpmask; int ret; + if (IS_ENABLED(CONFIG_ARM64_MPAM)) + return -EPERM; + rdtgrp = kernfs_to_rdtgroup(kn); new_prdtgrp = kernfs_to_rdtgroup(new_parent); if (!rdtgrp || !new_prdtgrp) @@ -3940,20 +3940,6 @@ static int rdtgroup_rename(struct kernfs_node *kn, goto out; } - /* - * Unlike RDT, the rmid and closid in MPAM have a hierarchical - * relationship. Therefore, first check whether there are still - * free rmids available under the target closid. - */ - if (IS_ENABLED(CONFIG_ARM64_MPAM)) { - entry = resctrl_find_free_rmid(new_prdtgrp->closid); - if (IS_ERR(entry)) { - rdt_last_cmd_puts("Destination has been out of RMIDs\n"); - ret = PTR_ERR(entry); - goto out; - } - } - /* * Allocate the cpumask for use in mongrp_reparent() to avoid the * possibility of failing to allocate it after kernfs_rename() has -- 2.43.0