diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2007-10-15 11:00:14 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:14 -0400 |
commit | 5cb350baf580017da38199625b7365b1763d7180 (patch) | |
tree | 3830339798b1c6f19f1580700ea6ba240fb56ef2 /include/linux/sched.h | |
parent | 8ca0e14ffb12c257de591571a9e96102acdb1c64 (diff) |
sched: group scheduling, sysfs tunables
Add tunables in sysfs to modify a user's cpu share.
A directory is created in sysfs for each new user in the system.
/sys/kernel/uids/<uid>/cpu_share
Reading this file returns the cpu shares granted for the user.
Writing into this file modifies the cpu share for the user. Only an
administrator is allowed to modify a user's cpu share.
Ex:
# cd /sys/kernel/uids/
# cat 512/cpu_share
1024
# echo 2048 > 512/cpu_share
# cat 512/cpu_share
2048
#
Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 3cddbfc0c91d..04233c8974d9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -87,6 +87,7 @@ struct sched_param { | |||
87 | #include <linux/timer.h> | 87 | #include <linux/timer.h> |
88 | #include <linux/hrtimer.h> | 88 | #include <linux/hrtimer.h> |
89 | #include <linux/task_io_accounting.h> | 89 | #include <linux/task_io_accounting.h> |
90 | #include <linux/kobject.h> | ||
90 | 91 | ||
91 | #include <asm/processor.h> | 92 | #include <asm/processor.h> |
92 | 93 | ||
@@ -599,9 +600,18 @@ struct user_struct { | |||
599 | 600 | ||
600 | #ifdef CONFIG_FAIR_USER_SCHED | 601 | #ifdef CONFIG_FAIR_USER_SCHED |
601 | struct task_group *tg; | 602 | struct task_group *tg; |
603 | struct kset kset; | ||
604 | struct subsys_attribute user_attr; | ||
605 | struct work_struct work; | ||
602 | #endif | 606 | #endif |
603 | }; | 607 | }; |
604 | 608 | ||
609 | #ifdef CONFIG_FAIR_USER_SCHED | ||
610 | extern int uids_kobject_init(void); | ||
611 | #else | ||
612 | static inline int uids_kobject_init(void) { return 0; } | ||
613 | #endif | ||
614 | |||
605 | extern struct user_struct *find_user(uid_t); | 615 | extern struct user_struct *find_user(uid_t); |
606 | 616 | ||
607 | extern struct user_struct root_user; | 617 | extern struct user_struct root_user; |
@@ -1848,6 +1858,7 @@ extern struct task_group *sched_create_group(void); | |||
1848 | extern void sched_destroy_group(struct task_group *tg); | 1858 | extern void sched_destroy_group(struct task_group *tg); |
1849 | extern void sched_move_task(struct task_struct *tsk); | 1859 | extern void sched_move_task(struct task_struct *tsk); |
1850 | extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); | 1860 | extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); |
1861 | extern unsigned long sched_group_shares(struct task_group *tg); | ||
1851 | 1862 | ||
1852 | #endif | 1863 | #endif |
1853 | 1864 | ||