Index: linux-2.6.12-rc6/fs/pipe.c
===================================================================
--- linux-2.6.12-rc6.orig/fs/pipe.c	2005-06-07 09:52:29.000000000 +1000
+++ linux-2.6.12-rc6/fs/pipe.c	2005-06-07 09:52:42.000000000 +1000
@@ -39,7 +39,11 @@ void pipe_wait(struct inode * inode)
 {
 	DEFINE_WAIT(wait);
 
-	prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE);
+	/*
+	 * Pipes are system-local resources, so sleeping on them
+	 * is considered a noninteractive wait:
+	 */
+	prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
 	up(PIPE_SEM(*inode));
 	schedule();
 	finish_wait(PIPE_WAIT(*inode), &wait);
Index: linux-2.6.12-rc6/include/linux/sched.h
===================================================================
--- linux-2.6.12-rc6.orig/include/linux/sched.h	2005-06-07 09:48:06.000000000 +1000
+++ linux-2.6.12-rc6/include/linux/sched.h	2005-06-07 09:52:42.000000000 +1000
@@ -112,6 +112,7 @@ extern unsigned long nr_iowait(void);
 #define TASK_TRACED		8
 #define EXIT_ZOMBIE		16
 #define EXIT_DEAD		32
+#define TASK_NONINTERACTIVE	64
 
 #define __set_task_state(tsk, state_value)		\
 	do { (tsk)->state = (state_value); } while (0)
@@ -790,9 +791,8 @@ do { if (atomic_dec_and_test(&(tsk)->usa
 #define PF_SYNCWRITE	0x00200000	/* I am doing a sync write */
 #define PF_BORROWED_MM	0x00400000	/* I am a kthread doing use_mm */
 #define PF_RANDOMIZE	0x00800000	/* randomize virtual address space */
-#define PF_FORKED	0x01000000	/* I have just forked */
+#define PF_NONSLEEP	0x01000000	/* Waiting on in kernel activity */
 #define PF_YIELDED	0x02000000	/* I have just yielded */
-#define PF_UISLEEP	0x04000000	/* Uninterruptible sleep */
 
 /*
  * Only the _current_ task can read/write to tsk->flags, but other
Index: linux-2.6.12-rc6/kernel/sched.c
===================================================================
--- linux-2.6.12-rc6.orig/kernel/sched.c	2005-06-07 09:48:06.000000000 +1000
+++ linux-2.6.12-rc6/kernel/sched.c	2005-06-07 09:52:42.000000000 +1000
@@ -16,9 +16,9 @@
  *		by Davide Libenzi, preemptible kernel bits by Robert Love.
  *  2003-09-03	Interactivity tuning by Con Kolivas.
  *  2004-04-02	Scheduler domains code by Nick Piggin
- *  2005-05-08	New staircase scheduling policy by Con Kolivas with help
+ *  2005-06-07	New staircase scheduling policy by Con Kolivas with help
  *		from William Lee Irwin III, Zwane Mwaikambo & Peter Williams.
- *		Staircase v11.2
+ *		Staircase v11.3
  */
 
 #include <linux/mm.h>
@@ -124,7 +124,6 @@ struct runqueue {
 	 * it on another CPU. Always updated under the runqueue lock:
 	 */
 	unsigned long nr_uninterruptible;
-	unsigned long systime_centile;
 
 	unsigned long long timestamp_last_tick;
 	unsigned int cache_ticks, preempted;
@@ -628,30 +627,28 @@ static void continue_slice(task_t *p)
  * slice instead of starting a new one at high priority.
  */
 static inline void recalc_task_prio(task_t *p, unsigned long long now,
-	unsigned long rq_systime, unsigned long rq_running)
+	unsigned long rq_running)
 {
 	unsigned long sleep_time = ns_diff(now, p->timestamp);
 
 	/*
 	 * Priority is elevated back to best by amount of sleep_time.
-	 * sleep_time is scaled down by in-kernel system time and by
-	 * number of tasks currently running.
+	 * sleep_time is scaled down by number of tasks currently running.
 	 */
-	sleep_time /= rq_running + 1;
-	if (rq_systime)
-		sleep_time = sleep_time / 200 * (100 - rq_systime);
+	if (rq_running > 1)
+		sleep_time /= rq_running;
 
 	p->totalrun += p->runtime;
 	if (NS_TO_JIFFIES(p->totalrun) >= p->slice &&
 		NS_TO_JIFFIES(sleep_time) < p->slice) {
-			p->flags &= ~PF_FORKED;
+			p->flags &= ~PF_NONSLEEP;
 			dec_burst(p);
 			goto new_slice;
 	}
 
-	if (p->flags & PF_FORKED) {
+	if (p->flags & PF_NONSLEEP) {
 		continue_slice(p);
-		p->flags &= ~PF_FORKED;
+		p->flags &= ~PF_NONSLEEP;
 		goto out;
 	}
 
@@ -661,7 +658,7 @@ static inline void recalc_task_prio(task
 	}
 
 	if (sleep_time >= p->totalrun) {
-		if (!(p->flags & PF_UISLEEP))
+		if (!(p->flags & PF_NONSLEEP))
 			inc_burst(p);
 		goto new_slice;
 	}
@@ -694,8 +691,8 @@ static void activate_task(task_t *p, run
 #endif
 	p->slice = slice(p);
 	p->time_slice = rr_interval(p);
-	recalc_task_prio(p, now, rq->systime_centile / 100, rq->nr_running);
-	p->flags &= ~PF_UISLEEP;
+	recalc_task_prio(p, now, rq->nr_running);
+	p->flags &= ~PF_NONSLEEP;
 	p->prio = effective_prio(p);
 	p->timestamp = now;
 	__activate_task(p, rq);
@@ -1066,6 +1063,13 @@ out_activate:
 		rq->nr_uninterruptible--;
 
 	/*
+	 * Tasks that have marked their sleep as noninteractive get
+	 * woken up without their sleep counting.
+	 */
+	if (old_state & TASK_NONINTERACTIVE)
+		p->flags |= PF_NONSLEEP;
+
+	/*
 	 * 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
@@ -1159,7 +1163,7 @@ void fastcall wake_up_new_task(task_t * 
 	p->burst = 0;
 
 	if (likely(cpu == this_cpu)) {
-		current->flags |= PF_FORKED;
+		current->flags |= PF_NONSLEEP;
 		activate_task(p, rq, 1);
 		if (!(clone_flags & CLONE_VM))
 			/*
@@ -1193,7 +1197,7 @@ void fastcall wake_up_new_task(task_t * 
 		 */
 		task_rq_unlock(rq, &flags);
 		this_rq = task_rq_lock(current, &flags);
-		current->flags |= PF_FORKED;
+		current->flags |= PF_NONSLEEP;
 	}
 	task_rq_unlock(this_rq, &flags);
 }
@@ -2178,8 +2182,6 @@ void account_system_time(struct task_str
 	else
 		cpustat->idle = cputime64_add(cpustat->idle, tmp);
 
-	/* For calculating rolling percentage of sys time per runqueue */
-	rq->systime_centile += cputime * 100;
 	/* Account for system time used */
 	acct_update_integrals(p);
 	/* Update rss highwater mark */
@@ -2231,9 +2233,6 @@ void scheduler_tick(void)
 	update_cpu_clock(p, rq, now);
 
 	rq->timestamp_last_tick = now;
-	/* Rolling percentage systime per runqueue */
-	rq->systime_centile = rq->systime_centile * 99 / 100;
-
 
 	if (p == rq->idle) {
 		if (wake_priority_sleeper(rq))
@@ -2536,7 +2535,7 @@ need_resched_nonpreemptible:
 			prev->state = TASK_RUNNING;
 		else {
 			if (prev->state == TASK_UNINTERRUPTIBLE) {
-				prev->flags |= PF_UISLEEP;
+				prev->flags |= PF_NONSLEEP;
 				rq->nr_uninterruptible++;
 			}
 			deactivate_task(prev, rq);
