diff options
| -rw-r--r-- | include/linux/sched.h | 6 | ||||
| -rw-r--r-- | kernel/sched/core.c | 82 | ||||
| -rw-r--r-- | kernel/sched/cpupri.c | 4 | ||||
| -rw-r--r-- | kernel/sched/fair.c | 10 |
4 files changed, 77 insertions, 25 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index d722490da030..078066daffd4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1532,6 +1532,8 @@ static inline pid_t task_pgrp_nr(struct task_struct *tsk) | |||
| 1532 | * Test if a process is not yet dead (at most zombie state) | 1532 | * Test if a process is not yet dead (at most zombie state) |
| 1533 | * If pid_alive fails, then pointers within the task structure | 1533 | * If pid_alive fails, then pointers within the task structure |
| 1534 | * can be stale and must not be dereferenced. | 1534 | * can be stale and must not be dereferenced. |
| 1535 | * | ||
| 1536 | * Return: 1 if the process is alive. 0 otherwise. | ||
| 1535 | */ | 1537 | */ |
| 1536 | static inline int pid_alive(struct task_struct *p) | 1538 | static inline int pid_alive(struct task_struct *p) |
| 1537 | { | 1539 | { |
| @@ -1543,6 +1545,8 @@ static inline int pid_alive(struct task_struct *p) | |||
| 1543 | * @tsk: Task structure to be checked. | 1545 | * @tsk: Task structure to be checked. |
| 1544 | * | 1546 | * |
| 1545 | * Check if a task structure is the first user space task the kernel created. | 1547 | * Check if a task structure is the first user space task the kernel created. |
| 1548 | * | ||
| 1549 | * Return: 1 if the task structure is init. 0 otherwise. | ||
| 1546 | */ | 1550 | */ |
| 1547 | static inline int is_global_init(struct task_struct *tsk) | 1551 | static inline int is_global_init(struct task_struct *tsk) |
| 1548 | { | 1552 | { |
| @@ -1894,6 +1898,8 @@ extern struct task_struct *idle_task(int cpu); | |||
| 1894 | /** | 1898 | /** |
| 1895 | * is_idle_task - is the specified task an idle task? | 1899 | * is_idle_task - is the specified task an idle task? |
| 1896 | * @p: the task in question. | 1900 | * @p: the task in question. |
| 1901 | * | ||
| 1902 | * Return: 1 if @p is an idle task. 0 otherwise. | ||
| 1897 | */ | 1903 | */ |
| 1898 | static inline bool is_idle_task(const struct task_struct *p) | 1904 | static inline bool is_idle_task(const struct task_struct *p) |
| 1899 | { | 1905 | { |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ef51b0ef4bdc..05c39f030314 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -933,6 +933,8 @@ static int effective_prio(struct task_struct *p) | |||
| 933 | /** | 933 | /** |
| 934 | * task_curr - is this task currently executing on a CPU? | 934 | * task_curr - is this task currently executing on a CPU? |
| 935 | * @p: the task in question. | 935 | * @p: the task in question. |
| 936 | * | ||
| 937 | * Return: 1 if the task is currently executing. 0 otherwise. | ||
| 936 | */ | 938 | */ |
| 937 | inline int task_curr(const struct task_struct *p) | 939 | inline int task_curr(const struct task_struct *p) |
| 938 | { | 940 | { |
| @@ -1482,7 +1484,7 @@ static void ttwu_queue(struct task_struct *p, int cpu) | |||
| 1482 | * the simpler "current->state = TASK_RUNNING" to mark yourself | 1484 | * the simpler "current->state = TASK_RUNNING" to mark yourself |
| 1483 | * runnable without the overhead of this. | 1485 | * runnable without the overhead of this. |
| 1484 | * | 1486 | * |
| 1485 | * Returns %true if @p was woken up, %false if it was already running | 1487 | * Return: %true if @p was woken up, %false if it was already running. |
| 1486 | * or @state didn't match @p's state. | 1488 | * or @state didn't match @p's state. |
| 1487 | */ | 1489 | */ |
| 1488 | static int | 1490 | static int |
| @@ -1583,8 +1585,9 @@ out: | |||
| 1583 | * @p: The process to be woken up. | 1585 | * @p: The process to be woken up. |
| 1584 | * | 1586 | * |
| 1585 | * Attempt to wake up the nominated process and move it to the set of runnable | 1587 | * Attempt to wake up the nominated process and move it to the set of runnable |
| 1586 | * processes. Returns 1 if the process was woken up, 0 if it was already | 1588 | * processes. |
| 1587 | * running. | 1589 | * |
| 1590 | * Return: 1 if the process was woken up, 0 if it was already running. | ||
| 1588 | * | 1591 | * |
| 1589 | * It may be assumed that this function implies a write memory barrier before | 1592 | * It may be assumed that this function implies a write memory barrier before |
| 1590 | * changing the task state if and only if any tasks are woken up. | 1593 | * changing the task state if and only if any tasks are woken up. |
| @@ -2197,6 +2200,8 @@ void scheduler_tick(void) | |||
| 2197 | * This makes sure that uptime, CFS vruntime, load | 2200 | * This makes sure that uptime, CFS vruntime, load |
| 2198 | * balancing, etc... continue to move forward, even | 2201 | * balancing, etc... continue to move forward, even |
| 2199 | * with a very low granularity. | 2202 | * with a very low granularity. |
| 2203 | * | ||
| 2204 | * Return: Maximum deferment in nanoseconds. | ||
| 2200 | */ | 2205 | */ |
| 2201 | u64 scheduler_tick_max_deferment(void) | 2206 | u64 scheduler_tick_max_deferment(void) |
| 2202 | { | 2207 | { |
| @@ -2808,8 +2813,8 @@ EXPORT_SYMBOL(wait_for_completion); | |||
| 2808 | * specified timeout to expire. The timeout is in jiffies. It is not | 2813 | * specified timeout to expire. The timeout is in jiffies. It is not |
| 2809 | * interruptible. | 2814 | * interruptible. |
| 2810 | * | 2815 | * |
| 2811 | * The return value is 0 if timed out, and positive (at least 1, or number of | 2816 | * Return: 0 if timed out, and positive (at least 1, or number of jiffies left |
| 2812 | * jiffies left till timeout) if completed. | 2817 | * till timeout) if completed. |
| 2813 | */ | 2818 | */ |
| 2814 | unsigned long __sched | 2819 | unsigned long __sched |
| 2815 | wait_for_completion_timeout(struct completion *x, unsigned long timeout) | 2820 | wait_for_completion_timeout(struct completion *x, unsigned long timeout) |
| @@ -2841,8 +2846,8 @@ EXPORT_SYMBOL(wait_for_completion_io); | |||
| 2841 | * specified timeout to expire. The timeout is in jiffies. It is not | 2846 | * specified timeout to expire. The timeout is in jiffies. It is not |
| 2842 | * interruptible. The caller is accounted as waiting for IO. | 2847 | * interruptible. The caller is accounted as waiting for IO. |
| 2843 | * | 2848 | * |
| 2844 | * The return value is 0 if timed out, and positive (at least 1, or number of | 2849 | * Return: 0 if timed out, and positive (at least 1, or number of jiffies left |
| 2845 | * jiffies left till timeout) if completed. | 2850 | * till timeout) if completed. |
| 2846 | */ | 2851 | */ |
| 2847 | unsigned long __sched | 2852 | unsigned long __sched |
| 2848 | wait_for_completion_io_timeout(struct completion *x, unsigned long timeout) | 2853 | wait_for_completion_io_timeout(struct completion *x, unsigned long timeout) |
| @@ -2858,7 +2863,7 @@ EXPORT_SYMBOL(wait_for_completion_io_timeout); | |||
| 2858 | * This waits for completion of a specific task to be signaled. It is | 2863 | * This waits for completion of a specific task to be signaled. It is |
| 2859 | * interruptible. | 2864 | * interruptible. |
| 2860 | * | 2865 | * |
| 2861 | * The return value is -ERESTARTSYS if interrupted, 0 if completed. | 2866 | * Return: -ERESTARTSYS if interrupted, 0 if completed. |
| 2862 | */ | 2867 | */ |
| 2863 | int __sched wait_for_completion_interruptible(struct completion *x) | 2868 | int __sched wait_for_completion_interruptible(struct completion *x) |
| 2864 | { | 2869 | { |
| @@ -2877,8 +2882,8 @@ EXPORT_SYMBOL(wait_for_completion_interruptible); | |||
| 2877 | * This waits for either a completion of a specific task to be signaled or for a | 2882 | * This waits for either a completion of a specific task to be signaled or for a |
| 2878 | * specified timeout to expire. It is interruptible. The timeout is in jiffies. | 2883 | * specified timeout to expire. It is interruptible. The timeout is in jiffies. |
| 2879 | * | 2884 | * |
| 2880 | * The return value is -ERESTARTSYS if interrupted, 0 if timed out, | 2885 | * Return: -ERESTARTSYS if interrupted, 0 if timed out, positive (at least 1, |
| 2881 | * positive (at least 1, or number of jiffies left till timeout) if completed. | 2886 | * or number of jiffies left till timeout) if completed. |
| 2882 | */ | 2887 | */ |
| 2883 | long __sched | 2888 | long __sched |
| 2884 | wait_for_completion_interruptible_timeout(struct completion *x, | 2889 | wait_for_completion_interruptible_timeout(struct completion *x, |
| @@ -2895,7 +2900,7 @@ EXPORT_SYMBOL(wait_for_completion_interruptible_timeout); | |||
| 2895 | * This waits to be signaled for completion of a specific task. It can be | 2900 | * This waits to be signaled for completion of a specific task. It can be |
| 2896 | * interrupted by a kill signal. | 2901 | * interrupted by a kill signal. |
| 2897 | * | 2902 | * |
| 2898 | * The return value is -ERESTARTSYS if interrupted, 0 if completed. | 2903 | * Return: -ERESTARTSYS if interrupted, 0 if completed. |
| 2899 | */ | 2904 | */ |
| 2900 | int __sched wait_for_completion_killable(struct completion *x) | 2905 | int __sched wait_for_completion_killable(struct completion *x) |
| 2901 | { | 2906 | { |
| @@ -2915,8 +2920,8 @@ EXPORT_SYMBOL(wait_for_completion_killable); | |||
| 2915 | * signaled or for a specified timeout to expire. It can be | 2920 | * signaled or for a specified timeout to expire. It can be |
| 2916 | * interrupted by a kill signal. The timeout is in jiffies. | 2921 | * interrupted by a kill signal. The timeout is in jiffies. |
| 2917 | * | 2922 | * |
| 2918 | * The return value is -ERESTARTSYS if interrupted, 0 if timed out, | 2923 | * Return: -ERESTARTSYS if interrupted, 0 if timed out, positive (at least 1, |
| 2919 | * positive (at least 1, or number of jiffies left till timeout) if completed. | 2924 | * or number of jiffies left till timeout) if completed. |
| 2920 | */ | 2925 | */ |
| 2921 | long __sched | 2926 | long __sched |
| 2922 | wait_for_completion_killable_timeout(struct completion *x, | 2927 | wait_for_completion_killable_timeout(struct completion *x, |
| @@ -2930,7 +2935,7 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout); | |||
| 2930 | * try_wait_for_completion - try to decrement a completion without blocking | 2935 | * try_wait_for_completion - try to decrement a completion without blocking |
| 2931 | * @x: completion structure | 2936 | * @x: completion structure |
| 2932 | * | 2937 | * |
| 2933 | * Returns: 0 if a decrement cannot be done without blocking | 2938 | * Return: 0 if a decrement cannot be done without blocking |
| 2934 | * 1 if a decrement succeeded. | 2939 | * 1 if a decrement succeeded. |
| 2935 | * | 2940 | * |
| 2936 | * If a completion is being used as a counting completion, | 2941 | * If a completion is being used as a counting completion, |
| @@ -2957,7 +2962,7 @@ EXPORT_SYMBOL(try_wait_for_completion); | |||
| 2957 | * completion_done - Test to see if a completion has any waiters | 2962 | * completion_done - Test to see if a completion has any waiters |
| 2958 | * @x: completion structure | 2963 | * @x: completion structure |
| 2959 | * | 2964 | * |
| 2960 | * Returns: 0 if there are waiters (wait_for_completion() in progress) | 2965 | * Return: 0 if there are waiters (wait_for_completion() in progress) |
| 2961 | * 1 if there are no waiters. | 2966 | * 1 if there are no waiters. |
| 2962 | * | 2967 | * |
| 2963 | */ | 2968 | */ |
| @@ -3194,7 +3199,7 @@ SYSCALL_DEFINE1(nice, int, increment) | |||
| 3194 | * task_prio - return the priority value of a given task. | 3199 | * task_prio - return the priority value of a given task. |
| 3195 | * @p: the task in question. | 3200 | * @p: the task in question. |
| 3196 | * | 3201 | * |
| 3197 | * This is the priority value as seen by users in /proc. | 3202 | * Return: The priority value as seen by users in /proc. |
| 3198 | * RT tasks are offset by -200. Normal tasks are centered | 3203 | * RT tasks are offset by -200. Normal tasks are centered |
| 3199 | * around 0, value goes from -16 to +15. | 3204 | * around 0, value goes from -16 to +15. |
| 3200 | */ | 3205 | */ |
| @@ -3206,6 +3211,8 @@ int task_prio(const struct task_struct *p) | |||
| 3206 | /** | 3211 | /** |
| 3207 | * task_nice - return the nice value of a given task. | 3212 | * task_nice - return the nice value of a given task. |
| 3208 | * @p: the task in question. | 3213 | * @p: the task in question. |
| 3214 | * | ||
| 3215 | * Return: The nice value [ -20 ... 0 ... 19 ]. | ||
| 3209 | */ | 3216 | */ |
| 3210 | int task_nice(const struct task_struct *p) | 3217 | int task_nice(const struct task_struct *p) |
| 3211 | { | 3218 | { |
| @@ -3216,6 +3223,8 @@ EXPORT_SYMBOL(task_nice); | |||
| 3216 | /** | 3223 | /** |
| 3217 | * idle_cpu - is a given cpu idle currently? | 3224 | * idle_cpu - is a given cpu idle currently? |
| 3218 | * @cpu: the processor in question. | 3225 | * @cpu: the processor in question. |
| 3226 | * | ||
| 3227 | * Return: 1 if the CPU is currently idle. 0 otherwise. | ||
| 3219 | */ | 3228 | */ |
| 3220 | int idle_cpu(int cpu) | 3229 | int idle_cpu(int cpu) |
| 3221 | { | 3230 | { |
| @@ -3238,6 +3247,8 @@ int idle_cpu(int cpu) | |||
| 3238 | /** | 3247 | /** |
| 3239 | * idle_task - return the idle task for a given cpu. | 3248 | * idle_task - return the idle task for a given cpu. |
| 3240 | * @cpu: the processor in question. | 3249 | * @cpu: the processor in question. |
| 3250 | * | ||
| 3251 | * Return: The idle task for the cpu @cpu. | ||
| 3241 | */ | 3252 | */ |
| 3242 | struct task_struct *idle_task(int cpu) | 3253 | struct task_struct *idle_task(int cpu) |
| 3243 | { | 3254 | { |
| @@ -3247,6 +3258,8 @@ struct task_struct *idle_task(int cpu) | |||
| 3247 | /** | 3258 | /** |
| 3248 | * find_process_by_pid - find a process with a matching PID value. | 3259 | * find_process_by_pid - find a process with a matching PID value. |
| 3249 | * @pid: the pid in question. | 3260 | * @pid: the pid in question. |
| 3261 | * | ||
| 3262 | * The task of @pid, if found. %NULL otherwise. | ||
| 3250 | */ | 3263 | */ |
| 3251 | static struct task_struct *find_process_by_pid(pid_t pid) | 3264 | static struct task_struct *find_process_by_pid(pid_t pid) |
| 3252 | { | 3265 | { |
| @@ -3444,6 +3457,8 @@ recheck: | |||
| 3444 | * @policy: new policy. | 3457 | * @policy: new policy. |
| 3445 | * @param: structure containing the new RT priority. | 3458 | * @param: structure containing the new RT priority. |
| 3446 | * | 3459 | * |
| 3460 | * Return: 0 on success. An error code otherwise. | ||
| 3461 | * | ||
| 3447 | * NOTE that the task may be already dead. | 3462 | * NOTE that the task may be already dead. |
| 3448 | */ | 3463 | */ |
| 3449 | int sched_setscheduler(struct task_struct *p, int policy, | 3464 | int sched_setscheduler(struct task_struct *p, int policy, |
| @@ -3463,6 +3478,8 @@ EXPORT_SYMBOL_GPL(sched_setscheduler); | |||
| 3463 | * current context has permission. For example, this is needed in | 3478 | * current context has permission. For example, this is needed in |
| 3464 | * stop_machine(): we create temporary high priority worker threads, | 3479 | * stop_machine(): we create temporary high priority worker threads, |
| 3465 | * but our caller might not have that capability. | 3480 | * but our caller might not have that capability. |
| 3481 | * | ||
| 3482 | * Return: 0 on success. An error code otherwise. | ||
| 3466 | */ | 3483 | */ |
| 3467 | int sched_setscheduler_nocheck(struct task_struct *p, int policy, | 3484 | int sched_setscheduler_nocheck(struct task_struct *p, int policy, |
| 3468 | const struct sched_param *param) | 3485 | const struct sched_param *param) |
| @@ -3497,6 +3514,8 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | |||
| 3497 | * @pid: the pid in question. | 3514 | * @pid: the pid in question. |
| 3498 | * @policy: new policy. | 3515 | * @policy: new policy. |
| 3499 | * @param: structure containing the new RT priority. | 3516 | * @param: structure containing the new RT priority. |
| 3517 | * | ||
| 3518 | * Return: 0 on success. An error code otherwise. | ||
| 3500 | */ | 3519 | */ |
| 3501 | SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, | 3520 | SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, |
| 3502 | struct sched_param __user *, param) | 3521 | struct sched_param __user *, param) |
| @@ -3512,6 +3531,8 @@ SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, | |||
| 3512 | * sys_sched_setparam - set/change the RT priority of a thread | 3531 | * sys_sched_setparam - set/change the RT priority of a thread |
| 3513 | * @pid: the pid in question. | 3532 | * @pid: the pid in question. |
| 3514 | * @param: structure containing the new RT priority. | 3533 | * @param: structure containing the new RT priority. |
| 3534 | * | ||
| 3535 | * Return: 0 on success. An error code otherwise. | ||
| 3515 | */ | 3536 | */ |
| 3516 | SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) | 3537 | SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) |
| 3517 | { | 3538 | { |
| @@ -3521,6 +3542,9 @@ SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) | |||
| 3521 | /** | 3542 | /** |
| 3522 | * sys_sched_getscheduler - get the policy (scheduling class) of a thread | 3543 | * sys_sched_getscheduler - get the policy (scheduling class) of a thread |
| 3523 | * @pid: the pid in question. | 3544 | * @pid: the pid in question. |
| 3545 | * | ||
| 3546 | * Return: On success, the policy of the thread. Otherwise, a negative error | ||
| 3547 | * code. | ||
| 3524 | */ | 3548 | */ |
| 3525 | SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) | 3549 | SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) |
| 3526 | { | 3550 | { |
| @@ -3547,6 +3571,9 @@ SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) | |||
| 3547 | * sys_sched_getparam - get the RT priority of a thread | 3571 | * sys_sched_getparam - get the RT priority of a thread |
| 3548 | * @pid: the pid in question. | 3572 | * @pid: the pid in question. |
| 3549 | * @param: structure containing the RT priority. | 3573 | * @param: structure containing the RT priority. |
| 3574 | * | ||
| 3575 | * Return: On success, 0 and the RT priority is in @param. Otherwise, an error | ||
| 3576 | * code. | ||
| 3550 | */ | 3577 | */ |
| 3551 | SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) | 3578 | SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) |
| 3552 | { | 3579 | { |
| @@ -3671,6 +3698,8 @@ static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len, | |||
| 3671 | * @pid: pid of the process | 3698 | * @pid: pid of the process |
| 3672 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr | 3699 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr |
| 3673 | * @user_mask_ptr: user-space pointer to the new cpu mask | 3700 | * @user_mask_ptr: user-space pointer to the new cpu mask |
| 3701 | * | ||
| 3702 | * Return: 0 on success. An error code otherwise. | ||
| 3674 | */ | 3703 | */ |
| 3675 | SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len, | 3704 | SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len, |
| 3676 | unsigned long __user *, user_mask_ptr) | 3705 | unsigned long __user *, user_mask_ptr) |
| @@ -3722,6 +3751,8 @@ out_unlock: | |||
| 3722 | * @pid: pid of the process | 3751 | * @pid: pid of the process |
| 3723 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr | 3752 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr |
| 3724 | * @user_mask_ptr: user-space pointer to hold the current cpu mask | 3753 | * @user_mask_ptr: user-space pointer to hold the current cpu mask |
| 3754 | * | ||
| 3755 | * Return: 0 on success. An error code otherwise. | ||
| 3725 | */ | 3756 | */ |
| 3726 | SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, | 3757 | SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, |
| 3727 | unsigned long __user *, user_mask_ptr) | 3758 | unsigned long __user *, user_mask_ptr) |
| @@ -3756,6 +3787,8 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, | |||
| 3756 | * | 3787 | * |
| 3757 | * This function yields the current CPU to other tasks. If there are no | 3788 | * This function yields the current CPU to other tasks. If there are no |
| 3758 | * other threads running on this CPU then this function will return. | 3789 | * other threads running on this CPU then this function will return. |
| 3790 | * | ||
| 3791 | * Return: 0. | ||
| 3759 | */ | 3792 | */ |
| 3760 | SYSCALL_DEFINE0(sched_yield) | 3793 | SYSCALL_DEFINE0(sched_yield) |
| 3761 | { | 3794 | { |
| @@ -3881,7 +3914,7 @@ EXPORT_SYMBOL(yield); | |||
| 3881 | * It's the caller's job to ensure that the target task struct | 3914 | * It's the caller's job to ensure that the target task struct |
| 3882 | * can't go away on us before we can do any checks. | 3915 | * can't go away on us before we can do any checks. |
| 3883 | * | 3916 | * |
| 3884 | * Returns: | 3917 | * Return: |
| 3885 | * true (>0) if we indeed boosted the target task. | 3918 | * true (>0) if we indeed boosted the target task. |
| 3886 | * false (0) if we failed to boost the target. | 3919 | * false (0) if we failed to boost the target. |
| 3887 | * -ESRCH if there's no task to yield to. | 3920 | * -ESRCH if there's no task to yield to. |
| @@ -3984,8 +4017,9 @@ long __sched io_schedule_timeout(long timeout) | |||
| 3984 | * sys_sched_get_priority_max - return maximum RT priority. | 4017 | * sys_sched_get_priority_max - return maximum RT priority. |
| 3985 | * @policy: scheduling class. | 4018 | * @policy: scheduling class. |
| 3986 | * | 4019 | * |
| 3987 | * this syscall returns the maximum rt_priority that can be used | 4020 | * Return: On success, this syscall returns the maximum |
| 3988 | * by a given scheduling class. | 4021 | * rt_priority that can be used by a given scheduling class. |
| 4022 | * On failure, a negative error code is returned. | ||
| 3989 | */ | 4023 | */ |
| 3990 | SYSCALL_DEFINE1(sched_get_priority_max, int, policy) | 4024 | SYSCALL_DEFINE1(sched_get_priority_max, int, policy) |
| 3991 | { | 4025 | { |
| @@ -4009,8 +4043,9 @@ SYSCALL_DEFINE1(sched_get_priority_max, int, policy) | |||
| 4009 | * sys_sched_get_priority_min - return minimum RT priority. | 4043 | * sys_sched_get_priority_min - return minimum RT priority. |
| 4010 | * @policy: scheduling class. | 4044 | * @policy: scheduling class. |
| 4011 | * | 4045 | * |
| 4012 | * this syscall returns the minimum rt_priority that can be used | 4046 | * Return: On success, this syscall returns the minimum |
| 4013 | * by a given scheduling class. | 4047 | * rt_priority that can be used by a given scheduling class. |
| 4048 | * On failure, a negative error code is returned. | ||
| 4014 | */ | 4049 | */ |
| 4015 | SYSCALL_DEFINE1(sched_get_priority_min, int, policy) | 4050 | SYSCALL_DEFINE1(sched_get_priority_min, int, policy) |
| 4016 | { | 4051 | { |
| @@ -4036,6 +4071,9 @@ SYSCALL_DEFINE1(sched_get_priority_min, int, policy) | |||
| 4036 | * | 4071 | * |
| 4037 | * this syscall writes the default timeslice value of a given process | 4072 | * this syscall writes the default timeslice value of a given process |
| 4038 | * into the user-space timespec buffer. A value of '0' means infinity. | 4073 | * into the user-space timespec buffer. A value of '0' means infinity. |
| 4074 | * | ||
| 4075 | * Return: On success, 0 and the timeslice is in @interval. Otherwise, | ||
| 4076 | * an error code. | ||
| 4039 | */ | 4077 | */ |
| 4040 | SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, | 4078 | SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, |
| 4041 | struct timespec __user *, interval) | 4079 | struct timespec __user *, interval) |
| @@ -6644,6 +6682,8 @@ void normalize_rt_tasks(void) | |||
| 6644 | * @cpu: the processor in question. | 6682 | * @cpu: the processor in question. |
| 6645 | * | 6683 | * |
| 6646 | * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED! | 6684 | * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED! |
| 6685 | * | ||
| 6686 | * Return: The current task for @cpu. | ||
| 6647 | */ | 6687 | */ |
| 6648 | struct task_struct *curr_task(int cpu) | 6688 | struct task_struct *curr_task(int cpu) |
| 6649 | { | 6689 | { |
diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 1095e878a46f..8b836b376d91 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c | |||
| @@ -62,7 +62,7 @@ static int convert_prio(int prio) | |||
| 62 | * any discrepancies created by racing against the uncertainty of the current | 62 | * any discrepancies created by racing against the uncertainty of the current |
| 63 | * priority configuration. | 63 | * priority configuration. |
| 64 | * | 64 | * |
| 65 | * Returns: (int)bool - CPUs were found | 65 | * Return: (int)bool - CPUs were found |
| 66 | */ | 66 | */ |
| 67 | int cpupri_find(struct cpupri *cp, struct task_struct *p, | 67 | int cpupri_find(struct cpupri *cp, struct task_struct *p, |
| 68 | struct cpumask *lowest_mask) | 68 | struct cpumask *lowest_mask) |
| @@ -203,7 +203,7 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri) | |||
| 203 | * cpupri_init - initialize the cpupri structure | 203 | * cpupri_init - initialize the cpupri structure |
| 204 | * @cp: The cpupri context | 204 | * @cp: The cpupri context |
| 205 | * | 205 | * |
| 206 | * Returns: -ENOMEM if memory fails. | 206 | * Return: -ENOMEM on memory allocation failure. |
| 207 | */ | 207 | */ |
| 208 | int cpupri_init(struct cpupri *cp) | 208 | int cpupri_init(struct cpupri *cp) |
| 209 | { | 209 | { |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9565645e3202..68f1609ca149 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
| @@ -2032,6 +2032,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) | |||
| 2032 | */ | 2032 | */ |
| 2033 | update_entity_load_avg(curr, 1); | 2033 | update_entity_load_avg(curr, 1); |
| 2034 | update_cfs_rq_blocked_load(cfs_rq, 1); | 2034 | update_cfs_rq_blocked_load(cfs_rq, 1); |
| 2035 | update_cfs_shares(cfs_rq); | ||
| 2035 | 2036 | ||
| 2036 | #ifdef CONFIG_SCHED_HRTICK | 2037 | #ifdef CONFIG_SCHED_HRTICK |
| 2037 | /* | 2038 | /* |
| @@ -4280,6 +4281,8 @@ struct sg_lb_stats { | |||
| 4280 | * get_sd_load_idx - Obtain the load index for a given sched domain. | 4281 | * get_sd_load_idx - Obtain the load index for a given sched domain. |
| 4281 | * @sd: The sched_domain whose load_idx is to be obtained. | 4282 | * @sd: The sched_domain whose load_idx is to be obtained. |
| 4282 | * @idle: The Idle status of the CPU for whose sd load_icx is obtained. | 4283 | * @idle: The Idle status of the CPU for whose sd load_icx is obtained. |
| 4284 | * | ||
| 4285 | * Return: The load index. | ||
| 4283 | */ | 4286 | */ |
| 4284 | static inline int get_sd_load_idx(struct sched_domain *sd, | 4287 | static inline int get_sd_load_idx(struct sched_domain *sd, |
| 4285 | enum cpu_idle_type idle) | 4288 | enum cpu_idle_type idle) |
| @@ -4574,6 +4577,9 @@ static inline void update_sg_lb_stats(struct lb_env *env, | |||
| 4574 | * | 4577 | * |
| 4575 | * Determine if @sg is a busier group than the previously selected | 4578 | * Determine if @sg is a busier group than the previously selected |
| 4576 | * busiest group. | 4579 | * busiest group. |
| 4580 | * | ||
| 4581 | * Return: %true if @sg is a busier group than the previously selected | ||
| 4582 | * busiest group. %false otherwise. | ||
| 4577 | */ | 4583 | */ |
| 4578 | static bool update_sd_pick_busiest(struct lb_env *env, | 4584 | static bool update_sd_pick_busiest(struct lb_env *env, |
| 4579 | struct sd_lb_stats *sds, | 4585 | struct sd_lb_stats *sds, |
| @@ -4691,7 +4697,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, | |||
| 4691 | * assuming lower CPU number will be equivalent to lower a SMT thread | 4697 | * assuming lower CPU number will be equivalent to lower a SMT thread |
| 4692 | * number. | 4698 | * number. |
| 4693 | * | 4699 | * |
| 4694 | * Returns 1 when packing is required and a task should be moved to | 4700 | * Return: 1 when packing is required and a task should be moved to |
| 4695 | * this CPU. The amount of the imbalance is returned in *imbalance. | 4701 | * this CPU. The amount of the imbalance is returned in *imbalance. |
| 4696 | * | 4702 | * |
| 4697 | * @env: The load balancing environment. | 4703 | * @env: The load balancing environment. |
| @@ -4869,7 +4875,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s | |||
| 4869 | * @balance: Pointer to a variable indicating if this_cpu | 4875 | * @balance: Pointer to a variable indicating if this_cpu |
| 4870 | * is the appropriate cpu to perform load balancing at this_level. | 4876 | * is the appropriate cpu to perform load balancing at this_level. |
| 4871 | * | 4877 | * |
| 4872 | * Returns: - the busiest group if imbalance exists. | 4878 | * Return: - The busiest group if imbalance exists. |
| 4873 | * - If no imbalance and user has opted for power-savings balance, | 4879 | * - If no imbalance and user has opted for power-savings balance, |
| 4874 | * return the least loaded group whose CPUs can be | 4880 | * return the least loaded group whose CPUs can be |
| 4875 | * put to idle by rebalancing its tasks onto our group. | 4881 | * put to idle by rebalancing its tasks onto our group. |
