Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39967
b: refs/heads/master
c: 91fcdd4
h: refs/heads/master
i:
  39965: 1c25e90
  39963: 21ad84f
  39959: fdd82fa
  39951: d858f0f
  39935: b6c8e1c
v: v3
  • Loading branch information
Borislav Petkov authored and Linus Torvalds committed Oct 20, 2006
1 parent 15dae89 commit 8107d0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 145fc655a1ceabda76cf2ad74f7cf96863c65b65
refs/heads/master: 91fcdd4e0314145d7d4fa52dba2f9c2da25346fd
18 changes: 9 additions & 9 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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);
Expand Down

0 comments on commit 8107d0e

Please sign in to comment.