Skip to content

Commit

Permalink
sched: rt-group: make rt groups scheduling configurable
Browse files Browse the repository at this point in the history
Make the rt group scheduler compile time configurable.
Keep it experimental for now.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 13, 2008
1 parent 9f0c1e5 commit 052f1dc
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 67 deletions.
2 changes: 1 addition & 1 deletion include/linux/cgroup_subsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SUBSYS(ns)

/* */

#ifdef CONFIG_FAIR_CGROUP_SCHED
#ifdef CONFIG_CGROUP_SCHED
SUBSYS(cpu_cgroup)
#endif

Expand Down
11 changes: 7 additions & 4 deletions include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ struct user_struct {
struct hlist_node uidhash_node;
uid_t uid;

#ifdef CONFIG_FAIR_USER_SCHED
#ifdef CONFIG_USER_SCHED
struct task_group *tg;
#ifdef CONFIG_SYSFS
struct kobject kobj;
Expand Down Expand Up @@ -973,7 +973,7 @@ struct sched_rt_entity {
unsigned long timeout;
int nr_cpus_allowed;

#ifdef CONFIG_FAIR_GROUP_SCHED
#ifdef CONFIG_RT_GROUP_SCHED
struct sched_rt_entity *parent;
/* rq on which this entity is (to be) queued: */
struct rt_rq *rt_rq;
Expand Down Expand Up @@ -2027,19 +2027,22 @@ extern int sched_mc_power_savings, sched_smt_power_savings;

extern void normalize_rt_tasks(void);

#ifdef CONFIG_FAIR_GROUP_SCHED
#ifdef CONFIG_GROUP_SCHED

extern struct task_group init_task_group;

extern struct task_group *sched_create_group(void);
extern void sched_destroy_group(struct task_group *tg);
extern void sched_move_task(struct task_struct *tsk);
#ifdef CONFIG_FAIR_GROUP_SCHED
extern int sched_group_set_shares(struct task_group *tg, unsigned long shares);
extern unsigned long sched_group_shares(struct task_group *tg);
#endif
#ifdef CONFIG_RT_GROUP_SCHED
extern int sched_group_set_rt_runtime(struct task_group *tg,
long rt_runtime_us);
extern long sched_group_rt_runtime(struct task_group *tg);

#endif
#endif

#ifdef CONFIG_TASK_XACCT
Expand Down
23 changes: 17 additions & 6 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -311,25 +311,36 @@ config CPUSETS

Say N if unsure.

config FAIR_GROUP_SCHED
bool "Fair group CPU scheduler"
config GROUP_SCHED
bool "Group CPU scheduler"
default y
help
This feature lets CPU scheduler recognize task groups and control CPU
bandwidth allocation to such task groups.

config FAIR_GROUP_SCHED
bool "Group scheduling for SCHED_OTHER"
depends on GROUP_SCHED
default y

config RT_GROUP_SCHED
bool "Group scheduling for SCHED_RR/FIFO"
depends on EXPERIMENTAL
depends on GROUP_SCHED
default n

choice
depends on FAIR_GROUP_SCHED
depends on GROUP_SCHED
prompt "Basis for grouping tasks"
default FAIR_USER_SCHED
default USER_SCHED

config FAIR_USER_SCHED
config USER_SCHED
bool "user id"
help
This option will choose userid as the basis for grouping
tasks, thus providing equal CPU bandwidth to each user.

config FAIR_CGROUP_SCHED
config CGROUP_SCHED
bool "Control groups"
depends on CGROUPS
help
Expand Down
Loading

0 comments on commit 052f1dc

Please sign in to comment.