summaryrefslogtreecommitdiffstats
path: root/kernel/sched_debug.c
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2007-10-15 17:00:14 +0200
committerIngo Molnar <mingo@elte.hu>2007-10-15 17:00:14 +0200
commit5cb350baf580017da38199625b7365b1763d7180 (patch)
tree3830339798b1c6f19f1580700ea6ba240fb56ef2 /kernel/sched_debug.c
parent8ca0e14ffb12c257de591571a9e96102acdb1c64 (diff)
downloadlinux-5cb350baf580017da38199625b7365b1763d7180.tar.bz2
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 'kernel/sched_debug.c')
-rw-r--r--kernel/sched_debug.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 6f87b31d233c..0aab455a7b41 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -231,45 +231,6 @@ static void sysrq_sched_debug_show(void)
sched_debug_show(NULL, NULL);
}
-#ifdef CONFIG_FAIR_USER_SCHED
-
-static DEFINE_MUTEX(root_user_share_mutex);
-
-static int
-root_user_share_read_proc(char *page, char **start, off_t off, int count,
- int *eof, void *data)
-{
- return sprintf(page, "%d\n", init_task_group_load);
-}
-
-static int
-root_user_share_write_proc(struct file *file, const char __user *buffer,
- unsigned long count, void *data)
-{
- unsigned long shares;
- char kbuf[sizeof(unsigned long)+1];
- int rc = 0;
-
- if (copy_from_user(kbuf, buffer, sizeof(kbuf)))
- return -EFAULT;
-
- shares = simple_strtoul(kbuf, NULL, 0);
-
- if (!shares)
- shares = NICE_0_LOAD;
-
- mutex_lock(&root_user_share_mutex);
-
- init_task_group_load = shares;
- rc = sched_group_set_shares(&init_task_group, shares);
-
- mutex_unlock(&root_user_share_mutex);
-
- return (rc < 0 ? rc : count);
-}
-
-#endif /* CONFIG_FAIR_USER_SCHED */
-
static int sched_debug_open(struct inode *inode, struct file *filp)
{
return single_open(filp, sched_debug_show, NULL);
@@ -292,15 +253,6 @@ static int __init init_sched_debug_procfs(void)
pe->proc_fops = &sched_debug_fops;
-#ifdef CONFIG_FAIR_USER_SCHED
- pe = create_proc_entry("root_user_cpu_share", 0644, NULL);
- if (!pe)
- return -ENOMEM;
-
- pe->read_proc = root_user_share_read_proc;
- pe->write_proc = root_user_share_write_proc;
-#endif
-
return 0;
}