aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2005-09-10 03:26:12 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 13:06:22 -0400
commitd79fc0fc6645b0cf5cd980da76942ca6d6300fa4 (patch)
treee74aca1df1d37dbd7af66636a4e39a3f7e1af479 /kernel/sched.c
parent95cdf3b799a481969a48d69a1a52916ad5da6694 (diff)
[PATCH] sched: TASK_NONINTERACTIVE
This patch implements a task state bit (TASK_NONINTERACTIVE), which can be used by blocking points to mark the task's wait as "non-interactive". This does not mean the task will be considered a CPU-hog - the wait will simply not have an effect on the waiting task's priority - positive or negative alike. Right now only pipe_wait() will make use of it, because it's a common source of not-so-interactive waits (kernel compilation jobs, etc.). Signed-off-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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 24eed372d280..6da13bba3e23 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1261,6 +1261,16 @@ out_activate:
1261 } 1261 }
1262 1262
1263 /* 1263 /*
1264 * Tasks that have marked their sleep as noninteractive get
1265 * woken up without updating their sleep average. (i.e. their
1266 * sleep is handled in a priority-neutral manner, no priority
1267 * boost and no penalty.)
1268 */
1269 if (old_state & TASK_NONINTERACTIVE)
1270 __activate_task(p, rq);
1271 else
1272 activate_task(p, rq, cpu == this_cpu);
1273 /*
1264 * Sync wakeups (i.e. those types of wakeups where the waker 1274 * Sync wakeups (i.e. those types of wakeups where the waker
1265 * has indicated that it will leave the CPU in short order) 1275 * has indicated that it will leave the CPU in short order)
1266 * don't trigger a preemption, if the woken up task will run on 1276 * don't trigger a preemption, if the woken up task will run on
@@ -1268,7 +1278,6 @@ out_activate:
1268 * the waker guarantees that the freshly woken up task is going 1278 * the waker guarantees that the freshly woken up task is going
1269 * to be considered on this CPU.) 1279 * to be considered on this CPU.)
1270 */ 1280 */
1271 activate_task(p, rq, cpu == this_cpu);
1272 if (!sync || cpu != this_cpu) { 1281 if (!sync || cpu != this_cpu) {
1273 if (TASK_PREEMPTS_CURR(p, rq)) 1282 if (TASK_PREEMPTS_CURR(p, rq))
1274 resched_task(rq->curr); 1283 resched_task(rq->curr);