[ovs-dev] [PATCH v3 8/8] lib/ovs-atomic: Native support for 32-bit 586 with GCC.

Ben Pfaff blp at nicira.com
Tue Aug 5 18:40:28 UTC 2014


On Thu, Jul 31, 2014 at 03:21:54PM -0700, Jarno Rajahalme wrote:
> 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 at nicira.com>

Great work, thank you very much!

Acked-by: Ben Pfaff <blp at nicira.com>



More information about the dev mailing list