| From | Sent On | Attachments |
|---|---|---|
| Alexander Motin | Feb 5, 2012 11:04 pm | |
| David Xu | Feb 5, 2012 11:59 pm | |
| Gary Jennejohn | Feb 6, 2012 2:08 am | |
| Alexander Best | Feb 6, 2012 8:01 am | |
| Alexander Motin | Feb 6, 2012 8:28 am | |
| Tijl Coosemans | Feb 6, 2012 9:37 am | |
| Alexander Motin | Feb 6, 2012 9:54 am | |
| Florian Smeets | Feb 6, 2012 11:07 am | |
| Alexander Best | Feb 6, 2012 11:10 am | |
| Alexander Motin | Feb 6, 2012 11:18 am | |
| Julian Elischer | Feb 6, 2012 10:10 pm | |
| Ivan Voras | Feb 8, 2012 3:06 am | |
| Andriy Gapon | Feb 11, 2012 5:34 am | |
| Alexander Motin | Feb 11, 2012 6:21 am | |
| Konstantin Belousov | Feb 11, 2012 7:35 am | |
| Andriy Gapon | Feb 11, 2012 9:04 am | |
| Alexander Motin | Feb 13, 2012 11:56 am | |
| Jeff Roberson | Feb 13, 2012 12:23 pm | |
| Alexander Motin | Feb 13, 2012 12:54 pm | |
| Jeff Roberson | Feb 13, 2012 1:39 pm | |
| Alexander Motin | Feb 13, 2012 2:38 pm | |
| Alexander Motin | Feb 15, 2012 11:46 am | |
| Jeff Roberson | Feb 15, 2012 11:54 am | |
| Alexander Motin | Feb 15, 2012 12:06 pm | |
| Alexander Motin | Feb 15, 2012 8:41 pm | |
| Alexander Motin | Feb 16, 2012 12:48 am | |
| Alexander Motin | Feb 16, 2012 2:58 am | |
| Florian Smeets | Feb 16, 2012 1:28 pm | |
| Alexander Motin | Feb 17, 2012 8:29 am | |
| Arnaud Lacombe | Feb 17, 2012 8:52 am | |
| Alexander Motin | Feb 17, 2012 9:02 am | |
| George Mitchell | Feb 26, 2012 4:32 pm | |
| George Mitchell | Feb 26, 2012 4:37 pm | |
| Olivier Smedts | Feb 27, 2012 2:34 am | |
| George Mitchell | Feb 27, 2012 3:23 am | |
| Olivier Smedts | Feb 27, 2012 3:27 am | |
| Andriy Gapon | Feb 27, 2012 4:41 am | |
| George Mitchell | Feb 27, 2012 3:54 pm | |
| Adrian Chadd | Mar 2, 2012 3:05 pm | |
| George Mitchell | Mar 2, 2012 4:14 pm | |
| Adrian Chadd | Mar 2, 2012 7:24 pm | |
| Alexander Motin | Mar 2, 2012 11:40 pm | |
| Ivan Klymenko | Mar 3, 2012 12:18 am | |
| Adrian Chadd | Mar 3, 2012 12:59 am | |
| Alexander Motin | Mar 3, 2012 1:12 am | |
| Alexander Motin | Mar 3, 2012 4:53 am | |
| Ivan Klymenko | Mar 3, 2012 7:25 am | |
| Alexander Motin | Mar 3, 2012 8:30 am | |
| Mario Lobo | Mar 3, 2012 8:56 am | |
| Alexander Motin | Mar 3, 2012 9:56 am | |
| Ivan Klymenko | Mar 3, 2012 11:15 am | |
| Arnaud Lacombe | Apr 5, 2012 11:11 am | |
| Alexander Motin | Apr 5, 2012 11:45 am | |
| Attilio Rao | Apr 6, 2012 7:12 am | |
| Alexander Motin | Apr 6, 2012 7:26 am | |
| Attilio Rao | Apr 6, 2012 7:30 am | |
| Alexander Motin | Apr 6, 2012 7:40 am | |
| Alexander Motin | Apr 9, 2012 12:57 pm | |
| Arnaud Lacombe | Apr 10, 2012 9:57 am | |
| Alexander Motin | Apr 10, 2012 10:18 am | |
| Alexander Motin | Apr 10, 2012 10:53 am | |
| Arnaud Lacombe | Apr 10, 2012 11:45 am | |
| Alexander Motin | Apr 10, 2012 12:13 pm | |
| Mike Meyer | Apr 10, 2012 1:04 pm | |
| Arnaud Lacombe | Apr 10, 2012 1:50 pm | |
| Mike Meyer | Apr 10, 2012 2:19 pm | |
| Adrian Chadd | Apr 11, 2012 3:19 pm |
| Subject: | [RFT][patch] Scheduling for HTT and not only | |
|---|---|---|
| From: | Alexander Motin (ma...@FreeBSD.org) | |
| Date: | Feb 5, 2012 11:04:03 pm | |
| List: | org.freebsd.freebsd-hackers | |
Hi.
I've analyzed scheduler behavior and think found the problem with HTT. SCHED_ULE knows about HTT and when doing load balancing once a second, it does right things. Unluckily, if some other thread gets in the way, process can be easily pushed out to another CPU, where it will stay for another second because of CPU affinity, possibly sharing physical core with something else without need.
I've made a patch, reworking SCHED_ULE affinity code, to fix that: http://people.freebsd.org/~mav/sched.htt.patch
This patch does three things: - Disables strict affinity optimization when HTT detected to let more sophisticated code to take into account load of other logical core(s). - Adds affinity support to the sched_lowest() function to prefer specified (last used) CPU (and CPU groups it belongs to) in case of equal load. Previous code always selected first valid CPU of evens. It caused threads migration to lower CPUs without need. - If current CPU group has no CPU where the process with its priority can run now, sequentially check parent CPU groups before doing global search. That should improve affinity for the next cache levels.
I've made several different benchmarks to test it, and so far results look promising: - On Atom D525 (2 physical cores + HTT) I've tested HTTP receive with fetch and FTP transmit with ftpd. On receive I've got 103MB/s on interface; on transmit somewhat less -- about 85MB/s. In both cases scheduler kept interrupt thread and application on different physical cores. Without patch speed fluctuating about 103-80MB/s on receive and is about 85MB/s on transmit. - On the same Atom I've tested TCP speed with iperf and got mostly the same results: - receive to Atom with patch -- 755-765Mbit/s, without patch -- 531-765Mbit/s. - transmit from Atom in both cases 679Mbit/s. Fluctuating receive behavior in both tests I think can be explained by some heavy callout handled by the swi4:clock process, called on receive (seen in top and schedgraph), but not on transmit. May be it is specifics of the Realtek NIC driver.
- On the same Atom tested number of 512 byte reads from SSD with dd in 1 and 32 streams. Found no regressions, but no benefits also as with one stream there is no congestion and with multiple streams all cores congested.
- On Core i7-2600K (4 physical cores + HTT) I've run more then 20 `make buildworld`s with different -j values (1,2,4,6,8,12,16) for both original and patched kernel. I've found no performance regressions, while for -j4 I've got 10% improvement: # ministat -w 65 res4A res4B x res4A + res4B +-----------------------------------------------------------------+ |+ | |++ x x x| |A| |______M__A__________| | +-----------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1554.86 1617.43 1571.62 1581.3033 32.389449 + 3 1420.69 1423.1 1421.36 1421.7167 1.2439587 Difference at 95.0% confidence -159.587 ± 51.9496 -10.0921% ± 3.28524% (Student's t, pooled s = 22.9197) , and for -j6 -- 3.6% improvement: # ministat -w 65 res6A res6B x res6A + res6B +-----------------------------------------------------------------+ | + | | + + x x x | ||_M__A___| |__________A____M_____|| +-----------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1381.17 1402.94 1400.3 1394.8033 11.880372 + 3 1340.4 1349.34 1341.23 1343.6567 4.9393758 Difference at 95.0% confidence -51.1467 ± 20.6211 -3.66694% ± 1.47842% (Student's t, pooled s = 9.09782)
Who wants to do independent testing to verify my results or do some more interesting benchmarks? :)
PS: Sponsored by iXsystems, Inc.
-- Alexander Motin
_______________________________________________ free...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "free...@freebsd.org"





