GSoC: Add SMT/HT awareness to DragonFlyBSD scheduler

Mihai Carabas mihai.carabas at gmail.com
Sat Jul 28 07:55:06 PDT 2012


--f46d044787e5a950a204c5e503e5
Content-Type: text/plain; charset=ISO-8859-1

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:(.

--f46d044787e5a950a204c5e503e5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<div><br></div><div>Sorry for not being so responsive on IRC on the e=
nd of this week (due to a personal problem).=A0My smt heuristic is on my re=
po now. The code still looks very ugly. I also made some new benchmarks.</d=
iv>
<div><br></div><div>Bad news: on the monster the performances are worst the=
n the original scheduler. I didn't figure out why. I will try next week=
 to do more testing.=A0Another 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.=
</div>
<div><br></div><div>Thanks ftigeot for giving me access to a dual-socket op=
teron (2 cpus). The results of testing:</div><div><br></div><div><div>#####=
####### enable smt ########</div><div>kern.usched_bsd4.smt_enable: 0 -> =
1</div>
<div>tps =3D 11505.350032 (including connections establishing)</div><div>tp=
s =3D 12358.802902 (including connections establishing)</div><div>tps =3D 1=
0376.294593 (including connections establishing)</div><div>tps =3D 10329.97=
6654 (including connections establishing)</div>
<div>tps =3D 11552.765499 (including connections establishing)</div><div>--=
----------------------------------------------------</div><div>average =3D =
11224 tps</div><div><br></div><div>############ disable smt ########</div><=
div>
kern.usched_bsd4.smt_enable: 1 -> 0</div><div>tps =3D 8950.803833 (inclu=
ding connections establishing)</div><div>tps =3D 9573.479233 (including con=
nections establishing)</div><div>tps =3D 8872.650887 (including connections=
 establishing)</div>
<div>tps =3D 10609.939778 (including connections establishing)</div><div>tp=
s =3D 10686.083868 (including connections establishing)</div><div>---------=
----------------------------------------------</div><div>average =3D 9738 t=
ps</div>
<div><br></div><div>The command used was:</div><div>pgbench -U pgsql -j 2 -=
c 2 -T 60 -S bench100 -h 127.0.0.1 2> /dev/null | grep "including c=
onnections establishing"</div></div><div><br></div><div>As you can see=
 there is an important improvement. The results aren't so constant (bec=
ause 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).</div>
<div><br></div><div>Another set of results on a core i7 (thanks Alex H):</d=
iv><div><span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;fon=
t-size:13px;background-color:rgb(255,255,255)">############ enable smt ####=
####</span><br style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;fo=
nt-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">kern.usched_bsd4.smt_enable: 1 ->=
 1</span><br style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font=
-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 36375.309531 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 35434.699607 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 35427.481274 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 35547.498123 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 35535.797652 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 33267.048739 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 35380.664997 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 33678.524173 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 33910.144898 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 30349.382087 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 31087.796990 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 32740.578796 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 29954.491639 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 31722.491643 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 30934.444499 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 31265.718351 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13p=
x;background-color:rgb(255,255,255)"><span style=3D"color:rgb(34,34,34);fon=
t-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"=
>############ disable smt ########</span><br style=3D"color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255=
)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">kern.usched_bsd4.smt_enable: 1 ->=
 0</span><br style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font=
-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 29049.152255 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 29634.008878 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 29271.273355 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 29001.174185 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 27541.959314 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 27643.877745 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 28197.062219 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 28535.076922 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 27269.922809 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 28948.932997 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 25764.057272 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 29550.489042 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 28679.242036 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 28552.329103 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 27933.380285 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
3px;background-color:rgb(255,255,255)">tps =3D 28727.222455 (including conn=
ections establishing)</span><br style=3D"color:rgb(34,34,34);font-family:ar=
ial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
</div><div><br></div><div>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:(.</div>

--f46d044787e5a950a204c5e503e5--





More information about the Kernel mailing list