hulk inclusion category: cleanup bugzilla: https://atomgit.com/openeuler/kernel/issues/8423 ---------------------------------------- Remove the standalone xcu_cfs_cg_deinit() helper and inline its functionality directly into the scheduler class switch handler in xcu_cg_set_sched_class(). This change simplifies the code by eliminating a single-use helper and ensures that CFS-specific teardown——namely, removing the group’s shares from its parent and deinitializing per-XCU runqueues——is performed precisely when the scheduling class changes. Signed-off-by: Liu Kai <liukai284@huawei.com> --- kernel/xsched/cgroup.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/xsched/cgroup.c b/kernel/xsched/cgroup.c index cc09b7bac34a..1e233a88d0f5 100644 --- a/kernel/xsched/cgroup.c +++ b/kernel/xsched/cgroup.c @@ -168,12 +168,6 @@ static int xcu_cfs_cg_init(struct xsched_group *xcg, return 0; } -static void xcu_cfs_cg_deinit(struct xsched_group *xcg) -{ - xcg_perxcu_cfs_rq_deinit(xcg, num_active_xcu); - xcu_grp_shares_sub(xcg->parent, xcg); -} - /** * xcu_cg_init() - Initialize non-root xsched_group structure. * @xcg: new xsched_cgroup @@ -498,7 +492,8 @@ static int xcu_cg_set_sched_class(struct xsched_group *xg, int type) /* deinit old type if necessary */ switch (xg->sched_class) { case XSCHED_TYPE_CFS: - xcu_cfs_cg_deinit(xg); + xcu_grp_shares_sub(xg->parent, xg); + xcg_perxcu_cfs_rq_deinit(xg, num_active_xcu); break; default: break; -- 2.34.1