Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
"Docbook fixes that make 99% of the diffstat, plus a oneliner fix"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched: Ensure update_cfs_shares() is called for parents of continuously-running tasks
sched: Fix some kernel-doc warnings

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