bfs 400 -> 401
authorDennis Groenen <dennis_groenen@hotmail.com>
Tue, 26 Apr 2011 14:54:51 +0000 (16:54 +0200)
committerDennis Groenen <dennis_groenen@hotmail.com>
Tue, 26 Apr 2011 14:54:51 +0000 (16:54 +0200)
kernel-bfs-2.6.28/debian/patches/bfs-400-to-401.patch [new file with mode: 0644]
kernel-bfs-2.6.28/debian/patches/series

diff --git a/kernel-bfs-2.6.28/debian/patches/bfs-400-to-401.patch b/kernel-bfs-2.6.28/debian/patches/bfs-400-to-401.patch
new file mode 100644 (file)
index 0000000..da9ceac
--- /dev/null
@@ -0,0 +1,65 @@
+last_ran isn't being set reliably and on tasks that run for under one timer
+tick, they may be seen as using up their timeslice the next time they're
+scheduled. The lower the Hz, the more relevant this change will be.
+Bug reported by Serge Belyshev.
+
+timeslice() can be an int.
+Patch by _sid_
+
+try_preempt need not check for rq_prio == highest_prio as it will always be by
+that point in the code.
+Patch by _sid_.
+
+-ck
+
+---
+ include/linux/sched.h |    2 +-
+ kernel/sched_bfs.c    |    8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+Index: linux-2.6.28/kernel/sched_bfs.c
+===================================================================
+--- linux-2.6.28.orig/kernel/sched_bfs.c
++++ linux-2.6.28/kernel/sched_bfs.c
+@@ -162,7 +162,7 @@ static int prio_ratios[PRIO_RANGE] __rea
+  * The quota handed out to tasks of all priority levels when refilling their
+  * time_slice.
+  */
+-static inline unsigned long timeslice(void)
++static inline int timeslice(void)
+ {
+       return MS_TO_US(rr_interval);
+ }
+@@ -1385,8 +1385,8 @@ static void try_preempt(struct task_stru
+               if (rq_prio < highest_prio)
+                       continue;
+-              if (rq_prio > highest_prio || (rq_prio == highest_prio &&
+-                  deadline_after(rq->rq_deadline, latest_deadline))) {
++              if (rq_prio > highest_prio ||
++                  deadline_after(rq->rq_deadline, latest_deadline)) {
+                       latest_deadline = rq->rq_deadline;
+                       highest_prio = rq_prio;
+                       highest_prio_rq = rq;
+@@ -2775,7 +2775,7 @@ static inline void set_rq_task(struct rq
+ {
+       rq->rq_time_slice = p->time_slice;
+       rq->rq_deadline = p->deadline;
+-      rq->rq_last_ran = p->last_ran;
++      rq->rq_last_ran = p->last_ran = rq->clock;
+       rq->rq_policy = p->policy;
+       rq->rq_prio = p->prio;
+       if (p != rq->idle)
+Index: linux-2.6.28/include/linux/sched.h
+===================================================================
+--- linux-2.6.28.orig/include/linux/sched.h
++++ linux-2.6.28/include/linux/sched.h
+@@ -1430,7 +1430,7 @@ static inline void tsk_cpus_current(stru
+ static inline void print_scheduler_version(void)
+ {
+-      printk(KERN_INFO"BFS CPU scheduler v0.400 by Con Kolivas.\n");
++      printk(KERN_INFO"BFS CPU scheduler v0.401 by Con Kolivas.\n");
+ }
+ static inline int iso_task(struct task_struct *p)
index 004cf64..efe8920 100644 (file)
@@ -39,6 +39,7 @@ bfs-350-to-357.patch
 bfs-357-to-360.patch
 bfs-360-to-363.patch
 bfs-363-to-400.patch
+bfs-400-to-401.patch
 voltage_scaling_1.diff
 voltage_scaling_0.diff
 armthumb.diff