realloc+write benchmark - vysledky patche
Radim Kolar
hsn at netmag.cz
Wed Jan 28 19:35:35 CET 2004
> Dival jsem se na malloc/realloc kod v freebsd i v linuxu... nejsem na to
> odbornik, ale zda se mi to priblizne stejne. akorat v fbsd se s tou zonou
> primo
ted mne napadlo ze to neni freebsd brk() vs linux brk() ale freebsd brk() vs
linux remap(). Kdyz pominu usermode implementaci realloc( memcpy se pocita do
user time), tak free bsd stejne spotrebovava neuveritelny pocet systemovyho
casu ve srovnani s linuxem2.4. Ten rozdil je 21 vs 0.6 sec. To znamena ze
algoritmus pro alokaci pameti je opravdu hodne pomaly.
Tezko rici zda se patch nejak projevila. Pokud ano, tak jen na hranici
meritelnosti.
freebsd 5.2 kernel s patchi. -M zapisuje do narealokovane pameti, -m ne.
./forkbomb -l 64 -i 256 -M --quit 16.77s user 21.38s system 98% cpu 38.591 tota
l
./forkbomb -l 64 -i 256 -M --quit 16.84s user 21.57s system 98% cpu 38.968 tota
l
./forkbomb -l 64 -i 256 -M --quit 17.14s user 20.80s system 98% cpu 38.367 tota
l
./forkbomb -l 64 -i 256 -M --quit 16.41s user 22.11s system 97% cpu 39.462 tota
l
./forkbomb -l 64 -i 256 -M --quit >> forkbomb.patched 17.12s user 20.84s system
98% cpu 38.380 total
./forkbomb -l 64 -i 256 -M --quit > /dev/null 16.95s user 20.85s system 98% cpu
38.221 total
./forkbomb -l 64 -i 256 -M --quit > /dev/null 17.15s user 20.84s system 98% cpu
38.408 total
./forkbomb -l 64 -i 256 -M --quit > /dev/null 16.78s user 21.23s system 98% cpu
38.441 total
=======================================
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.12s user 31.30s system 98% cpu
48.329 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.27s user 31.62s system 98% cpu
48.447 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 15.98s user 31.79s system 98% cpu
48.313 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.18s user 31.57s system 98% cpu
48.297 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 15.80s user 31.76s system 98% cpu
48.097 total
//////////////////nepatchovany kernel///////////////////////
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 15.91s user 32.26s system 98% cpu
48.738 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 15.85s user 32.22s system 98% cpu
48.653 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.27s user 31.71s system 98% cpu
48.537 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.25s user 31.73s system 98% cpu
48.527 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null
./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.18s user 31.78s system 98% cpu
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 16.95s user 21.52s system 98% cpu
38.895 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 17.04s user 21.43s system 96% cpu
39.845 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 16.73s user 21.72s system 97% cpu
39.558 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 17.31s user 20.89s system 98% cpu
38.682 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 16.92s user 21.37s system 98% cpu
38.716 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 16.74s user 21.47s system 98% cpu
38.636 total
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null
./forkbomb -l 64 -i 256 -M --quit > /dev/null 17.10s user 21.29s system 98% cpu
38.819 total
/////////////////////// linux 2.4 / glibc 2.3.2 \\\\\\\\\\\\\\\\\\\
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu 0.000 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu 0.000 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu 0.000 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu 0.000 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu 0.000 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu 0.000 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:22
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.02s user 0.59s system 96% cpu 0.634 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.01s user 0.60s system 95% cpu 0.637 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.02s user 0.59s system 96% cpu 0.634 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.02s user 0.59s system 96% cpu 0.633 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.02s user 0.59s system 95% cpu 0.636 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.04s user 0.57s system 96% cpu 0.633 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.00s user 0.61s system 95% cpu 0.636 total
(hsn at tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24
./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.03s user 0.58s system 96% cpu 0.634 total
More information about the Users-l
mailing list