mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Signed-off-by: Dhaval Giani <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
8ca0e14ffb
commit
5cb350baf5
6 changed files with 309 additions and 79 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kexec.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#define KERNEL_ATTR_RO(_name) \
|
||||
static struct subsys_attribute _name##_attr = __ATTR_RO(_name)
|
||||
|
|
@ -116,6 +117,13 @@ static int __init ksysfs_init(void)
|
|||
¬es_attr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create "/sys/kernel/uids" directory and corresponding root user's
|
||||
* directory under it.
|
||||
*/
|
||||
if (!error)
|
||||
error = uids_kobject_init();
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue