aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorBorislav Petkov <bbpetkov@yahoo.de>2006-10-20 02:28:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:26:37 -0400
commit91fcdd4e0314145d7d4fa52dba2f9c2da25346fd (patch)
treea4defe96d7f86a1bc0ba8bdb6df51efcf271d347 /kernel/sched.c
parent145fc655a1ceabda76cf2ad74f7cf96863c65b65 (diff)
[PATCH] readjust comments of task_timeslice for kernel doc
Signed-off-by: Borislav Petkov <petkov@math.uni-muenster.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 094b5687eef6..3399701c680e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -160,15 +160,6 @@
160#define TASK_PREEMPTS_CURR(p, rq) \ 160#define TASK_PREEMPTS_CURR(p, rq) \
161 ((p)->prio < (rq)->curr->prio) 161 ((p)->prio < (rq)->curr->prio)
162 162
163/*
164 * task_timeslice() scales user-nice values [ -20 ... 0 ... 19 ]
165 * to time slice values: [800ms ... 100ms ... 5ms]
166 *
167 * The higher a thread's priority, the bigger timeslices
168 * it gets during one round of execution. But even the lowest
169 * priority thread gets MIN_TIMESLICE worth of execution time.
170 */
171
172#define SCALE_PRIO(x, prio) \ 163#define SCALE_PRIO(x, prio) \
173 max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_TIMESLICE) 164 max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_TIMESLICE)
174 165
@@ -180,6 +171,15 @@ static unsigned int static_prio_timeslice(int static_prio)
180 return SCALE_PRIO(DEF_TIMESLICE, static_prio); 171 return SCALE_PRIO(DEF_TIMESLICE, static_prio);
181} 172}
182 173
174/*
175 * task_timeslice() scales user-nice values [ -20 ... 0 ... 19 ]
176 * to time slice values: [800ms ... 100ms ... 5ms]
177 *
178 * The higher a thread's priority, the bigger timeslices
179 * it gets during one round of execution. But even the lowest
180 * priority thread gets MIN_TIMESLICE worth of execution time.
181 */
182
183static inline unsigned int task_timeslice(struct task_struct *p) 183static inline unsigned int task_timeslice(struct task_struct *p)
184{ 184{
185 return static_prio_timeslice(p->static_prio); 185 return static_prio_timeslice(p->static_prio);