Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24923
b: refs/heads/master
c: d425b27
h: refs/heads/master
i:
  24921: ebf0630
  24919: 335c527
v: v3
  • Loading branch information
Con Kolivas authored and Linus Torvalds committed Mar 31, 2006
1 parent b45b18d commit 392a0aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 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: 7c4bb1f9b3788309e1159961c606ba0bdf7ed382
refs/heads/master: d425b274ba83ba4e7746a40446ec0ba3267de51f
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ struct signal_struct {
#define MAX_PRIO (MAX_RT_PRIO + 40)

#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO))
#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))

/*
* Some day this will be a full-fledged user tracking system..
Expand Down
10 changes: 7 additions & 3 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,13 @@ static int effective_prio(task_t *p)
/*
* __activate_task - move a task to the runqueue.
*/
static inline void __activate_task(task_t *p, runqueue_t *rq)
static void __activate_task(task_t *p, runqueue_t *rq)
{
enqueue_task(p, rq->active);
prio_array_t *target = rq->active;

if (batch_task(p))
target = rq->expired;
enqueue_task(p, target);
rq->nr_running++;
}

Expand All @@ -688,7 +692,7 @@ static int recalc_task_prio(task_t *p, unsigned long long now)
unsigned long long __sleep_time = now - p->timestamp;
unsigned long sleep_time;

if (unlikely(p->policy == SCHED_BATCH))
if (batch_task(p))
sleep_time = 0;
else {
if (__sleep_time > NS_MAX_SLEEP_AVG)
Expand Down

0 comments on commit 392a0aa

Please sign in to comment.