Hello, Sorry for not being so responsive on IRC on the end of this week (due to a personal problem). My smt heuristic is on my repo now. The code still looks very ugly. I also made some new benchmarks.
Bad news: on the monster the performances are worst then the original scheduler. I didn't figure out why. I will try next week to do more testing. Another problem is if I modify the SMT heuristic, to make use of the HT topology (stick to the home cpu or its sibling because they share almost everything), there is no gain of perfomance (all the gain obtained by the SMT heuristic is lost). I haven't find the reason yet. Thanks ftigeot for giving me access to a dual-socket opteron (2 cpus). The results of testing: ############ enable smt ######## kern.usched_bsd4.smt_enable: 0 -> 1 tps = 11505.350032 (including connections establishing) tps = 12358.802902 (including connections establishing) tps = 10376.294593 (including connections establishing) tps = 10329.976654 (including connections establishing) tps = 11552.765499 (including connections establishing) ------------------------------------------------------ average = 11224 tps ############ disable smt ######## kern.usched_bsd4.smt_enable: 1 -> 0 tps = 8950.803833 (including connections establishing) tps = 9573.479233 (including connections establishing) tps = 8872.650887 (including connections establishing) tps = 10609.939778 (including connections establishing) tps = 10686.083868 (including connections establishing) ------------------------------------------------------- average = 9738 tps The command used was: pgbench -U pgsql -j 2 -c 2 -T 60 -S bench100 -h 127.0.0.1 2> /dev/null | grep "including connections establishing" As you can see there is an important improvement. The results aren't so constant (because of the heuristic way of scheduling - at the end of the GSOC I will put online all my discussions with Alex and Matthew regarding the problems of scheduling). Another set of results on a core i7 (thanks Alex H): ############ enable smt ######## kern.usched_bsd4.smt_enable: 1 -> 1 tps = 36375.309531 (including connections establishing) tps = 35434.699607 (including connections establishing) tps = 35427.481274 (including connections establishing) tps = 35547.498123 (including connections establishing) tps = 35535.797652 (including connections establishing) tps = 33267.048739 (including connections establishing) tps = 35380.664997 (including connections establishing) tps = 33678.524173 (including connections establishing) tps = 33910.144898 (including connections establishing) tps = 30349.382087 (including connections establishing) tps = 31087.796990 (including connections establishing) tps = 32740.578796 (including connections establishing) tps = 29954.491639 (including connections establishing) tps = 31722.491643 (including connections establishing) tps = 30934.444499 (including connections establishing) tps = 31265.718351 (including connections establishing) ############ disable smt ######## kern.usched_bsd4.smt_enable: 1 -> 0 tps = 29049.152255 (including connections establishing) tps = 29634.008878 (including connections establishing) tps = 29271.273355 (including connections establishing) tps = 29001.174185 (including connections establishing) tps = 27541.959314 (including connections establishing) tps = 27643.877745 (including connections establishing) tps = 28197.062219 (including connections establishing) tps = 28535.076922 (including connections establishing) tps = 27269.922809 (including connections establishing) tps = 28948.932997 (including connections establishing) tps = 25764.057272 (including connections establishing) tps = 29550.489042 (including connections establishing) tps = 28679.242036 (including connections establishing) tps = 28552.329103 (including connections establishing) tps = 27933.380285 (including connections establishing) tps = 28727.222455 (including connections establishing) I also obtained some better results on my core i3 than last week, but the location of my machine is out of internet now and I don't have access to the results:(.