summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2005-09-10 00:26:12 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 10:06:22 -0700
commitd79fc0fc6645b0cf5cd980da76942ca6d6300fa4 (patch)
treee74aca1df1d37dbd7af66636a4e39a3f7e1af479 /kernel
parent95cdf3b799a481969a48d69a1a52916ad5da6694 (diff)
downloadkernel-common-d79fc0fc6645b0cf5cd980da76942ca6d6300fa4.tar.gz
kernel-common-d79fc0fc6645b0cf5cd980da76942ca6d6300fa4.tar.bz2
kernel-common-d79fc0fc6645b0cf5cd980da76942ca6d6300fa4.zip
[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')
-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:
}
/*
+ * Tasks that have marked their sleep as noninteractive get
+ * woken up without updating their sleep average. (i.e. their
+ * sleep is handled in a priority-neutral manner, no priority
+ * boost and no penalty.)
+ */
+ if (old_state & TASK_NONINTERACTIVE)
+ __activate_task(p, rq);
+ else
+ activate_task(p, rq, cpu == this_cpu);
+ /*
* Sync wakeups (i.e. those types of wakeups where the waker
* has indicated that it will leave the CPU in short order)
* don't trigger a preemption, if the woken up task will run on
@@ -1268,7 +1278,6 @@ out_activate:
* the waker guarantees that the freshly woken up task is going
* to be considered on this CPU.)
*/
- activate_task(p, rq, cpu == this_cpu);
if (!sync || cpu != this_cpu) {
if (TASK_PREEMPTS_CURR(p, rq))
resched_task(rq->curr);