aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2006-06-13 13:12:56 +0000
committerDavid Xu <davidxu@FreeBSD.org>2006-06-13 13:12:56 +0000
commitb41f1452d951aad13aba458af52b7c051205b415 (patch)
treea9fec91142711752b931300f2309e4de17526aad /sys/kern/sched_4bsd.c
parent05922cdfccecde28f8de5e2688a54e641bebf2c2 (diff)
downloadsrc-b41f1452d951aad13aba458af52b7c051205b415.tar.gz
src-b41f1452d951aad13aba458af52b7c051205b415.zip
Add scheduler CORE, the work I have done half a year ago, recent,
I picked it up again. The scheduler is forked from ULE, but the algorithm to detect an interactive process is almost completely different with ULE, it comes from Linux paper "Understanding the Linux 2.6.8.1 CPU Scheduler", although I still use same word "score" as a priority boost in ULE scheduler. Briefly, the scheduler has following characteristic: 1. Timesharing process's nice value is seriously respected, timeslice and interaction detecting algorithm are based on nice value. 2. per-cpu scheduling queue and load balancing. 3. O(1) scheduling. 4. Some cpu affinity code in wakeup path. 5. Support POSIX SCHED_FIFO and SCHED_RR. Unlike scheduler 4BSD and ULE which using fuzzy RQ_PPQ, the scheduler uses 256 priority queues. Unlike ULE which using pull and push, the scheduelr uses pull method, the main reason is to let relative idle cpu do the work, but current the whole scheduler is protected by the big sched_lock, so the benefit is not visible, it really can be worse than nothing because all other cpu are locked out when we are doing balancing work, which the 4BSD scheduelr does not have this problem. The scheduler does not support hyperthreading very well, in fact, the scheduler does not make the difference between physical CPU and logical CPU, this should be improved in feature. The scheduler has priority inversion problem on MP machine, it is not good for realtime scheduling, it can cause realtime process starving. As a result, it seems the MySQL super-smack runs better on my Pentium-D machine when using libthr, despite on UP or SMP kernel.
Notes
Notes: svn path=/head/; revision=159570
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 25eba837b65d..60f6df6a5d14 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1386,5 +1386,10 @@ sched_pctcpu(struct thread *td)
return (0);
}
+
+void
+sched_tick(void)
+{
+}
#define KERN_SWITCH_INCLUDE 1
#include "kern/kern_switch.c"