[PATCH] um: borrow bitops from the x86 tree

Anton Ivanov anton.ivanov at cambridgegreys.com
Tue Nov 17 06:46:03 EST 2020



On 17/11/2020 11:05, Johannes Berg wrote:
> Hi Anton,
> 
> So I thought I'd test your performance patches here, and applied
> (hopefully the latest versions of) on top of 5.9:
> 
>        um: allow the use of glibc functions instead of builtins
>        um: Fetch registers only for signals which need them
>        um: enable the use of optimized xor routines in UML
>        um: add a UML specific futex implementation
>        um: Remove use of asprinf in umid.c
>        um: "borrow" atomics from x86 architecture
>        um: "borrow" cmpxchg from x86 tree in UML
>        um: borrow bitops from the x86 tree
> 
> 
> With the patches (compiled with glibc functions), one of my trivial
> virtual lab tests gets:
> 
>    Time (mean ± σ):     15.918 s ±  0.833 s    [User: 10.977 s, System: 5.600 s]
>    Range (min … max):   15.371 s … 17.986 s    10 runs
> 
> It's not a large improvement, it seems noticable; without the patches I
> get:
> 
>    Time (mean ± σ):     16.525 s ±  0.884 s    [User: 11.355 s, System: 5.648 s]
>    Range (min … max):   15.682 s … 18.088 s    10 runs
> 
> johannes
> 
> 

This is similar to what I get.

My usual test is:

  time busybox find /usr/lib/ -type f -exec cat {} > /dev/null \;

I discard the first run and use only runs from fs cache.

With stock I get

real	34.0 - 36.0
user 	29.6 - 29.9
sys	3.4 - 3.6


With the patch-set I get

real	32.0 - 34.0
user	28.2 - 29.2
sys	3.0 - 3.4

dd if=/dev/zero of=/dev/null bs=1M on the whole UBD device without the patches for 2nd run and later is 2.0GB/s - 2.1GB/s, with the patches is 2.2GB/s - 2.3GB/s

It is not a lot, but something - 2-5% on average depending on actual test.

The real gain will be to figure out how to optimize the memory mapper. It is the "handbrake" which slows down everything else.

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/



More information about the linux-um mailing list