Commit c835db9d authored by Cheng Yu's avatar Cheng Yu
Browse files

sched/fair: Add group_steal in cmdline to enable STEAL for cgroup

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IAQWPQ



-----------------------------------------

We add a new parameter group_steal in cmdline to enable the steal task
feature for cgroup. That is, when group_steal is not configured in
cmdline, it means the feature is enabled globally; after configuration,
it can be enabled only for a certain cgroup.

Signed-off-by: default avatarCheng Yu <serein.chengyu@huawei.com>
parent 39148316
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4459,6 +4459,14 @@ static inline void rq_idle_stamp_clear(struct rq *rq)
}

#ifdef CONFIG_SCHED_STEAL
DEFINE_STATIC_KEY_FALSE(group_steal);

static int __init group_steal_setup(char *__unused)
{
	static_branch_enable(&group_steal);
	return 1;
}
__setup("group_steal", group_steal_setup);

static inline bool steal_enabled(void)
{
+9 −0
Original line number Diff line number Diff line
@@ -1775,6 +1775,15 @@ extern void set_sched_cluster(void);
static inline void set_sched_cluster(void) { }
#endif

#ifdef CONFIG_SCHED_STEAL
DECLARE_STATIC_KEY_FALSE(group_steal);

static inline bool group_steal_used(void)
{
	return static_branch_unlikely(&group_steal);
}
#endif

#ifdef CONFIG_NUMA
#ifdef CONFIG_SCHED_STEAL
extern struct static_key_true sched_steal_allow;