Index: linux-2.6.7-mm6/include/linux/sched.h
===================================================================
--- linux-2.6.7-mm6.orig/include/linux/sched.h	2004-07-07 21:49:36.342044309 +1000
+++ linux-2.6.7-mm6/include/linux/sched.h	2004-07-07 21:49:43.726882594 +1000
@@ -127,9 +127,10 @@
 #define SCHED_FIFO		1
 #define SCHED_RR		2
 #define SCHED_BATCH		3
+#define SCHED_ISO		4
 
 #define SCHED_MIN		0
-#define SCHED_MAX		3
+#define SCHED_MAX		4
 
 #define SCHED_RANGE(policy)	((policy) >= SCHED_MIN && \
 					(policy) <= SCHED_MAX)
@@ -328,6 +329,7 @@
 
 #define rt_task(p)		(unlikely((p)->prio < MAX_RT_PRIO))
 #define batch_task(p)		((p)->policy == SCHED_BATCH)
+#define iso_task(p)		((p)->policy == SCHED_ISO)
 
 /*
  * Some day this will be a full-fledged user tracking system..
Index: linux-2.6.7-mm6/kernel/sched.c
===================================================================
--- linux-2.6.7-mm6.orig/kernel/sched.c	2004-07-07 21:49:07.965507981 +1000
+++ linux-2.6.7-mm6/kernel/sched.c	2004-07-07 21:49:43.729882122 +1000
@@ -190,6 +190,18 @@
 	spin_unlock_irq(&rq->lock);
 }
 
+static int rr_interval(task_t * p)
+{
+	int rr_interval = RR_INTERVAL();
+	if (batch_task(p))
+		rr_interval *= 10;
+	else if (iso_task(p))
+		rr_interval /= 2;
+	if (!rr_interval)
+		rr_interval = 1;
+	return rr_interval;
+}
+
 static int task_preempts_curr(struct task_struct *p, runqueue_t *rq)
 {
 	if (p->prio >= rq->curr->prio)
@@ -262,6 +274,8 @@
 	if (rt_task(p))
 		return p->burst;
 	task_user_prio = TASK_USER_PRIO(p);
+	if (iso_task(p))
+		task_user_prio /= 2;
 	if (likely(task_user_prio < 40))
 		return 39 - task_user_prio;
 	else
@@ -309,7 +323,7 @@
  */
 static int effective_prio(task_t *p)
 {
-	int prio;
+	int prio, rr;
 	unsigned int full_slice, used_slice, first_slice;
 	unsigned int best_burst;
 	if (rt_task(p))
@@ -328,17 +342,18 @@
 
 	best_burst = burst(p);
 	full_slice = slice(p);
+	rr = rr_interval(p);
 	used_slice = full_slice - p->slice;
 	if (p->burst > best_burst)
 		p->burst = best_burst;
-	first_slice = RR_INTERVAL();
-	if (sched_interactive && !sched_compute)
+	first_slice = rr;
+	if (sched_interactive && !sched_compute && !iso_task(p))
 		first_slice *= (p->burst + 1);
 	prio = MAX_PRIO - 2 - best_burst;
 
 	if (used_slice < first_slice)
 		return prio;
-	prio += 1 + (used_slice - first_slice) / RR_INTERVAL();
+	prio += 1 + (used_slice - first_slice) / rr;
 	if (prio > MAX_PRIO - 2)
 		prio = MAX_PRIO - 2;
 	return prio;
@@ -356,7 +371,7 @@
 	unsigned long total_run = NS_TO_JIFFIES(ns_totalrun);
 	if (p->flags & PF_FORKED || ((!(NS_TO_JIFFIES(p->runtime)) ||
 		!sched_interactive || sched_compute) && 
-		NS_TO_JIFFIES(p->runtime + sleep_time) < RR_INTERVAL())) {
+		NS_TO_JIFFIES(p->runtime + sleep_time) < rr_interval(p))) {
 			p->flags &= ~PF_FORKED;
 			if (p->slice - total_run < 1) {
 				p->totalrun = 0;
@@ -391,7 +406,7 @@
 	recalc_task_prio(p, now);
 	p->prio = effective_prio(p);
 	p->flags &= ~PF_UISLEEP;
-	p->time_slice = RR_INTERVAL();
+	p->time_slice = rr_interval(p);
 	if (batch_task(p))
 		p->time_slice *= 10;
 	p->timestamp = now;
@@ -1751,19 +1766,19 @@
 		dec_burst(p);
 		p->slice = slice(p);
 		p->prio = effective_prio(p);
-		p->time_slice = RR_INTERVAL();
+		p->time_slice = rr_interval(p);
 		enqueue_task(p, rq);
 		goto out_unlock;
 	}
 	/*
 	 * Tasks that run out of time_slice but still have slice left get
-	 * requeued with a lower priority && RR_INTERVAL time_slice.
+	 * requeued with a lower priority && rr_interval time_slice.
 	 */
 	if (!--p->time_slice) {
 		set_tsk_need_resched(p);
 		dequeue_task(p, rq);
 		p->prio = effective_prio(p);
-		p->time_slice = RR_INTERVAL();
+		p->time_slice = rr_interval(p);
 		enqueue_task(p, rq);
 		goto out_unlock;
 	}
@@ -2421,7 +2436,11 @@
 
 	retval = -EPERM;
 	if (SCHED_RT(policy) && !capable(CAP_SYS_NICE))
-		goto out_unlock;
+		/*
+		 * If the caller requested an RT policy without having the
+		 * necessary rights, we downgrade the policy to SCHED_ISO.
+		 */
+		policy = SCHED_ISO;
 	if ((current->euid != p->euid) && (current->euid != p->uid) &&
 	    !capable(CAP_SYS_NICE))
 		goto out_unlock;
@@ -2754,6 +2773,7 @@
 		break;
 	case SCHED_NORMAL:
 	case SCHED_BATCH:
+	case SCHED_ISO:
 		ret = 0;
 		break;
 	}
@@ -2778,6 +2798,7 @@
 		break;
 	case SCHED_NORMAL:
 	case SCHED_BATCH:
+	case SCHED_ISO:
 		ret = 0;
 	}
 	return ret;
