aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index cca93cc0dd7d..1fd67e16cd31 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -57,6 +57,16 @@
57#include <asm/unistd.h> 57#include <asm/unistd.h>
58 58
59/* 59/*
60 * Scheduler clock - returns current time in nanosec units.
61 * This is default implementation.
62 * Architectures and sub-architectures can override this.
63 */
64unsigned long long __attribute__((weak)) sched_clock(void)
65{
66 return (unsigned long long)jiffies * (1000000000 / HZ);
67}
68
69/*
60 * Convert user-nice values [ -20 ... 0 ... 19 ] 70 * Convert user-nice values [ -20 ... 0 ... 19 ]
61 * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], 71 * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
62 * and back. 72 * and back.
@@ -4193,13 +4203,12 @@ static void __setscheduler(struct task_struct *p, int policy, int prio)
4193} 4203}
4194 4204
4195/** 4205/**
4196 * sched_setscheduler - change the scheduling policy and/or RT priority of 4206 * sched_setscheduler - change the scheduling policy and/or RT priority of a thread.
4197 * a thread.
4198 * @p: the task in question. 4207 * @p: the task in question.
4199 * @policy: new policy. 4208 * @policy: new policy.
4200 * @param: structure containing the new RT priority. 4209 * @param: structure containing the new RT priority.
4201 * 4210 *
4202 * NOTE: the task may be already dead 4211 * NOTE that the task may be already dead.
4203 */ 4212 */
4204int sched_setscheduler(struct task_struct *p, int policy, 4213int sched_setscheduler(struct task_struct *p, int policy,
4205 struct sched_param *param) 4214 struct sched_param *param)
@@ -4567,7 +4576,7 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
4567/** 4576/**
4568 * sys_sched_yield - yield the current processor to other threads. 4577 * sys_sched_yield - yield the current processor to other threads.
4569 * 4578 *
4570 * this function yields the current CPU by moving the calling thread 4579 * This function yields the current CPU by moving the calling thread
4571 * to the expired array. If there are no other threads running on this 4580 * to the expired array. If there are no other threads running on this
4572 * CPU then this function will return. 4581 * CPU then this function will return.
4573 */ 4582 */
@@ -4694,7 +4703,7 @@ EXPORT_SYMBOL(cond_resched_softirq);
4694/** 4703/**
4695 * yield - yield the current processor to other threads. 4704 * yield - yield the current processor to other threads.
4696 * 4705 *
4697 * this is a shortcut for kernel-space yielding - it marks the 4706 * This is a shortcut for kernel-space yielding - it marks the
4698 * thread runnable and calls sys_sched_yield(). 4707 * thread runnable and calls sys_sched_yield().
4699 */ 4708 */
4700void __sched yield(void) 4709void __sched yield(void)