summaryrefslogtreecommitdiff
path: root/lib/ovs-atomic-i586.h
Commit message (Collapse)AuthorAgeFilesLines
* lib/ovs-atomic-i586: Faster 64-bit atomics on 32-bit builds with SSE.Jarno Rajahalme2014-10-021-31/+70
| | | | | | | | | | Aligned 64-bit memory accesses in i586 are atomic. By using an SSE register we can make such memory accesses in one instruction without bus-locking. Need to compile with -msse (or higher) to enable this feature. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib/ovs-atomic: Add missing macro argument parentheses.Jarno Rajahalme2014-08-291-16/+16
| | | | | | | | | | Otherwise the dereference operator could target a portion of a ternary expression, for example. Also minor style fixes. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib/ovs-atomic: Native support for 32-bit 586 with GCC.Jarno Rajahalme2014-08-051-0/+445
XenServer runs OVS in dom0, which is a 32-bit VM. As the build environment lacks support for atomics, locked pthread atomics were used with considerable performance hit. This patch adds native support for ovs-atomic with 32-bit Pentium and higher CPUs, when compiled with an older GCC. We use inline asm with the cmpxchg8b instruction, which was a new instruction to Intel Pentium processors. We do not expect anyone to run OVS on 486 or older processor. cmap benchmark before the patch on 32-bit XenServer build (uses ovs-atomic-pthread): $ tests/ovstest test-cmap benchmark 2000000 8 0.1 Benchmarking with n=2000000, 8 threads, 0.10% mutations: cmap insert: 8835 ms cmap iterate: 379 ms cmap search: 6242 ms cmap destroy: 1145 ms After: $ tests/ovstest test-cmap benchmark 2000000 8 0.1 Benchmarking with n=2000000, 8 threads, 0.10% mutations: cmap insert: 711 ms cmap iterate: 68 ms cmap search: 353 ms cmap destroy: 209 ms Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>