From 8107d0ef35b6fe9191c899990898d6639a7254bb Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 19 Oct 2006 23:28:29 -0700 Subject: [PATCH] --- yaml --- r: 39967 b: refs/heads/master c: 91fcdd4e0314145d7d4fa52dba2f9c2da25346fd h: refs/heads/master i: 39965: 1c25e90c3aaadc47bc9a96c551b21ef65615e5f9 39963: 21ad84f3b94aa9c07e164e481ea2cd041edde501 39959: fdd82fad0c9e3d0d3bc6807e111bceb9b74fea66 39951: d858f0fd3ee6722931d8ddb259dd1dbd30461c1b 39935: b6c8e1c1af01857c4703b74ccc9f998722120c20 v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 34b3b58fdbd9..82279a54ddf5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 145fc655a1ceabda76cf2ad74f7cf96863c65b65 +refs/heads/master: 91fcdd4e0314145d7d4fa52dba2f9c2da25346fd diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 094b5687eef6..3399701c680e 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -160,15 +160,6 @@ #define TASK_PREEMPTS_CURR(p, rq) \ ((p)->prio < (rq)->curr->prio) -/* - * task_timeslice() scales user-nice values [ -20 ... 0 ... 19 ] - * to time slice values: [800ms ... 100ms ... 5ms] - * - * The higher a thread's priority, the bigger timeslices - * it gets during one round of execution. But even the lowest - * priority thread gets MIN_TIMESLICE worth of execution time. - */ - #define SCALE_PRIO(x, prio) \ max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_TIMESLICE) @@ -180,6 +171,15 @@ static unsigned int static_prio_timeslice(int static_prio) return SCALE_PRIO(DEF_TIMESLICE, static_prio); } +/* + * task_timeslice() scales user-nice values [ -20 ... 0 ... 19 ] + * to time slice values: [800ms ... 100ms ... 5ms] + * + * The higher a thread's priority, the bigger timeslices + * it gets during one round of execution. But even the lowest + * priority thread gets MIN_TIMESLICE worth of execution time. + */ + static inline unsigned int task_timeslice(struct task_struct *p) { return static_prio_timeslice(p->static_prio);